Skip to content

Commit 714252d

Browse files
committed
Publish to Maven Central
1 parent e56bcf6 commit 714252d

File tree

3 files changed

+46
-83
lines changed

3 files changed

+46
-83
lines changed

Readme.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,11 @@ depend: [ ProtocolLib ]
4343
You can also add ProtocolLib as a Maven dependency:
4444

4545
````xml
46-
<repositories>
47-
<repository>
48-
<id>dmulloy2-repo</id>
49-
<url>https://repo.dmulloy2.net/repository/public/</url>
50-
</repository>
51-
</repositories>
52-
5346
<dependencies>
5447
<dependency>
55-
<groupId>com.comphenix.protocol</groupId>
48+
<groupId>net.dmulloy2</groupId>
5649
<artifactId>ProtocolLib</artifactId>
57-
<version>5.1.0</version>
50+
<version>5.3.0</version>
5851
<scope>provided</scope>
5952
</dependency>
6053
</dependencies>
@@ -64,11 +57,11 @@ Or use the maven dependency with gradle:
6457

6558
```gradle
6659
repositories {
67-
maven { url "https://repo.dmulloy2.net/repository/public/" }
60+
mavenCentral()
6861
}
6962
7063
dependencies {
71-
compileOnly 'com.comphenix.protocol:ProtocolLib:5.1.0'
64+
compileOnly 'com.comphenix.protocol:ProtocolLib:5.3.0'
7265
}
7366
```
7467

build.gradle.kts

Lines changed: 36 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
55
plugins {
66
`java-library`
77
`maven-publish`
8+
`signing`
89
id("com.gradleup.shadow") version "9.0.0-beta13"
910
id("io.github.patrick.remapper") version "1.4.2"
11+
id("com.vanniktech.maven.publish") version "0.34.0"
1012
}
1113

12-
group = "com.comphenix.protocol"
14+
group = "net.dmulloy2"
1315
description = "Provides access to the Minecraft protocol"
1416

1517
val mcVersion = "1.21.7"
@@ -125,84 +127,47 @@ tasks {
125127
compileJava {
126128
options.encoding = "UTF-8"
127129
}
130+
}
128131

129-
register<org.gradle.jvm.tasks.Jar>("javadocJar") {
130-
archiveClassifier.set("javadoc")
131-
from(getByName("javadoc"))
132-
}
132+
mavenPublishing {
133+
publishToMavenCentral()
134+
signAllPublications()
133135

134-
register<org.gradle.jvm.tasks.Jar>("sourcesJar") {
135-
archiveClassifier.set("sources")
136-
from(project.the<JavaPluginExtension>().sourceSets["main"].allJava)
137-
}
138-
}
136+
coordinates("${group}", project.name, "${version}")
137+
138+
pom {
139+
name.set(project.name)
140+
description.set(project.description)
141+
inceptionYear.set("2012")
142+
url.set("https://github.com/dmulloy2/ProtocolLib")
139143

140-
publishing {
141-
publications {
142-
create<MavenPublication>("maven") {
143-
from(components["java"])
144-
artifact(tasks.getByName("sourcesJar"))
145-
artifact(tasks.getByName("javadocJar"))
146-
147-
pom {
148-
name.set(project.name)
149-
description.set(project.description)
150-
url.set("https://github.com/dmulloy2/ProtocolLib")
151-
152-
developers {
153-
developer {
154-
id.set("dmulloy2")
155-
name.set("Dan Mulloy")
156-
url.set("https://dmulloy2.net/")
157-
}
158-
developer {
159-
id.set("aadnk")
160-
email.set("[email protected]")
161-
name.set("Kristian S. Stangeland")
162-
url.set("https://comphenix.net/")
163-
}
164-
}
165-
166-
licenses {
167-
license {
168-
name.set("GNU GENERAL PUBLIC LICENSE - Version 2, June 1991")
169-
url.set("https://www.gnu.org/licenses/gpl-2.0.txt")
170-
distribution.set("repo")
171-
}
172-
}
173-
174-
scm {
175-
tag.set("HEAD")
176-
url.set("https://github.com/dmulloy2/ProtocolLib")
177-
connection.set("scm:git:git://github.com/dmulloy2/ProtocolLib.git")
178-
developerConnection.set("scm:git:[email protected]:dmulloy2/ProtocolLib.git")
179-
}
180-
181-
issueManagement {
182-
system.set("GitHub Issues")
183-
url.set("https://github.com/dmulloy2/ProtocolLib/issues")
184-
}
185-
186-
ciManagement {
187-
system.set("Jenkins")
188-
url.set("https://ci.dmulloy2.net/job/ProtocolLib")
189-
}
144+
developers {
145+
developer {
146+
id.set("dmulloy2")
147+
name.set("Dan Mulloy")
148+
url.set("https://dmulloy2.net/")
149+
email.set("[email protected]")
190150
}
191151
}
192-
}
193152

194-
repositories {
195-
maven {
196-
url = if (isSnapshot) {
197-
uri("https://repo.dmulloy2.net/repository/snapshots/")
198-
} else {
199-
uri("https://repo.dmulloy2.net/repository/releases/")
153+
licenses {
154+
license {
155+
name.set("GNU GENERAL PUBLIC LICENSE - Version 2, June 1991")
156+
url.set("https://www.gnu.org/licenses/gpl-2.0.txt")
157+
distribution.set("repo")
200158
}
159+
}
201160

202-
credentials {
203-
username = System.getenv("NEXUS_USERNAME")
204-
password = System.getenv("NEXUS_PASSWORD")
205-
}
161+
scm {
162+
tag.set("HEAD")
163+
url.set("https://github.com/dmulloy2/ProtocolLib")
164+
connection.set("scm:git:git://github.com/dmulloy2/ProtocolLib.git")
165+
developerConnection.set("scm:git:[email protected]:dmulloy2/ProtocolLib.git")
166+
}
167+
168+
issueManagement {
169+
system.set("GitHub Issues")
170+
url.set("https://github.com/dmulloy2/ProtocolLib/issues")
206171
}
207172
}
208173
}

gradle.properties

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
version=5.4.0-SNAPSHOT
1+
version=5.4.0-SNAPSHOT
2+
mavenCentralUsername=
3+
mavenCentralPassword=
4+
signing.keyId=
5+
signing.password=
6+
signing.secretKeyRingFile=

0 commit comments

Comments
 (0)