Skip to content

Commit 629e844

Browse files
committed
feat(build): maven publishing
1 parent 0eb2856 commit 629e844

File tree

3 files changed

+109
-4
lines changed

3 files changed

+109
-4
lines changed

build.gradle

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ plugins {
33
}
44

55
allprojects {
6-
group = 'by.milansky'
7-
version = '1.0.0'
6+
group = 'by.milansky.protocol'
7+
version = '1.0.1'
88
}
99

1010
configure(subprojects - project(':examples')) {
1111
apply plugin: 'java'
12+
apply plugin: 'maven-publish'
1213

1314
repositories {
1415
mavenLocal()
@@ -46,6 +47,35 @@ configure(subprojects - project(':examples')) {
4647
testRuntimeOnly libs.junit.engine
4748
}
4849

50+
publishing {
51+
repositories {
52+
maven {
53+
name = "milansky-repo"
54+
url = uri("https://maven.milansky.ovh/releases")
55+
56+
credentials {
57+
username = System.getenv("MILANSKY_REPO_USER")
58+
password = System.getenv("MILANSKY_REPO_TOKEN")
59+
}
60+
}
61+
}
62+
63+
publications {
64+
gpr(MavenPublication) {
65+
from(components.java)
66+
67+
pom {
68+
licenses {
69+
license {
70+
name = 'MIT License'
71+
url = 'https://github.com/rmilansky/minecraft-protocol-java/blob/master/LICENSE'
72+
}
73+
}
74+
}
75+
}
76+
}
77+
}
78+
4979
test {
5080
useJUnitPlatform()
5181
}

bukkit/src/main/java/by/milansky/protocol/bukkit/ProtocolBukkit.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* @author milansky
2020
*/
2121
@Log4j2
22-
@Plugin(name = "Protocol", version = "1.0.0-ALPHA")
22+
@Plugin(name = "Protocol", version = "1.0.1-BETA")
2323
public class ProtocolBukkit extends JavaPlugin {
2424
private Injector injector;
2525

readme.md

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<img src=".assets/illustration.png" width="500"/>
33
<br>
44
<img src="https://img.shields.io/badge/language-java-gold?style=flat" />
5-
<img src="https://img.shields.io/badge/beta-v1.0-gold?style=flat" />
5+
<img src="https://img.shields.io/badge/beta-v1.0.1-gold?style=flat" />
66
<img src="https://img.shields.io/github/stars/rmilansky/minecraft-protocol-java?style=flat" />
77
</div>
88

@@ -25,8 +25,83 @@ This project is designed for the most convenient and integrable development of s
2525
* Simplify packet handling and monitoring as much as possible.
2626
* Ensure integration with all modern server cores and standalone applications.
2727

28+
#
29+
2830
# Usage Guide
2931

32+
## Maven / Gradle library adding
33+
34+
1. Add a repository:
35+
36+
Maven:
37+
```xml
38+
<repositories>
39+
<repository>
40+
<id>milansky-repo</id>
41+
<url>https://maven.milansky.ovh/releases</url>
42+
</repository>
43+
</repositories>
44+
```
45+
Gradle:
46+
```groovy
47+
repositories {
48+
maven {
49+
url = "https://maven.milansky.ovh/releases"
50+
}
51+
}
52+
```
53+
54+
2. Add dependencies
55+
56+
Maven:
57+
```xml
58+
<properties>
59+
<protocol.version>1.0.1</protocol.version>
60+
</properties>
61+
62+
<dependencies>
63+
<dependency>
64+
<groupId>by.milansky.protocol</groupId>
65+
<artifactId>api</artifactId>
66+
<version>${protocol.version}</version>
67+
</dependency>
68+
<dependency>
69+
<groupId>by.milansky.protocol</groupId>
70+
<artifactId>base</artifactId>
71+
<version>${protocol.version}</version>
72+
</dependency>
73+
<dependency>
74+
<groupId>by.milansky.protocol</groupId>
75+
<artifactId>vanilla-protocol</artifactId>
76+
<version>${protocol.version}</version>
77+
</dependency>
78+
79+
<!-- Add bukkit if you need it -->
80+
<dependency>
81+
<groupId>by.milansky.protocol</groupId>
82+
<artifactId>bukkit</artifactId>
83+
<version>${protocol.version}</version>
84+
</dependency>
85+
</dependencies>
86+
```
87+
88+
Gradle:
89+
```groovy
90+
dependencies {
91+
// It's better to use gradle's dependencyResolutionManagement
92+
def protocolVersion = '1.0.1'
93+
94+
compileOnly "by.milansky.protocol:api:${protocolVersion}"
95+
compileOnly "by.milansky.protocol:base:${protocolVersion}"
96+
compileOnly "by.milansky.protocol:vanilla-protocol:${protocolVersion}"
97+
98+
// Add bukkit if you need it
99+
compileOnly "by.milansky.protocol:bukkit:${protocolVersion}"
100+
}
101+
```
102+
103+
## Java API usage
104+
30105
More detailed usage examples can be found in the [examples](examples) directory. However, to briefly explain, here's how you can listen to all `ClientboundTeam` packets:
31106

32107
1. Create a handler to process packets:

0 commit comments

Comments
 (0)