Skip to content

Commit 50e474f

Browse files
committed
Adapt new central portal
Signed-off-by: Alexander Brandes <mc.cache@web.de>
1 parent cea2426 commit 50e474f

2 files changed

Lines changed: 52 additions & 73 deletions

File tree

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ jobs:
3232
fi
3333
- name: "Publish Release"
3434
if: "${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}"
35-
run: "./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository"
35+
run: "./gradlew publishAndReleaseToMavenCentral --no-configuration-cache"
3636
env :
37-
ORG_GRADLE_PROJECT_sonatypeUsername : "${{ secrets.SONATYPE_USERNAME }}"
38-
ORG_GRADLE_PROJECT_sonatypePassword : "${{ secrets.SONATYPE_PASSWORD }}"
37+
ORG_GRADLE_PROJECT_mavenCentralUsername : "${{ secrets.SONATYPE_USERNAME }}"
38+
ORG_GRADLE_PROJECT_mavenCentralPassword : "${{ secrets.SONATYPE_PASSWORD }}"
3939
ORG_GRADLE_PROJECT_signingKey : "${{ secrets.SIGNING_KEY }}"
4040
ORG_GRADLE_PROJECT_signingPassword : "${{ secrets.SIGNING_PASSWORD }}"
4141
- name : "Publish Snapshot"
4242
if : "${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}"
43-
run : "./gradlew publishToSonatype"
43+
run : "./gradlew publishAllPublicationsToMavenCentralRepository"
4444
env :
45-
ORG_GRADLE_PROJECT_sonatypeUsername : "${{ secrets.SONATYPE_USERNAME }}"
46-
ORG_GRADLE_PROJECT_sonatypePassword : "${{ secrets.SONATYPE_PASSWORD }}"
45+
ORG_GRADLE_PROJECT_mavenCentralUsername : "${{ secrets.SONATYPE_USERNAME }}"
46+
ORG_GRADLE_PROJECT_mavenCentralPassword : "${{ secrets.SONATYPE_PASSWORD }}"

build.gradle.kts

Lines changed: 46 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
import com.vanniktech.maven.publish.SonatypeHost
12
import com.diffplug.gradle.spotless.SpotlessPlugin
23
import java.net.URI
34

45
plugins {
56
java
67
`java-library`
7-
`maven-publish`
88
signing
99

10-
id("com.diffplug.spotless") version "6.25.0"
10+
id("com.diffplug.spotless") version "7.0.3"
1111
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
12+
id("com.vanniktech.maven.publish") version "0.31.0"
1213

1314
idea
1415
eclipse
@@ -28,7 +29,7 @@ version = "1.3.3-SNAPSHOT"
2829
repositories {
2930
maven {
3031
name = "PaperMC"
31-
url = uri("https://papermc.io/repo/repository/maven-public/")
32+
url = uri("https://repo.papermc.io/repository/maven-public/")
3233
}
3334
}
3435

@@ -45,24 +46,9 @@ spotless {
4546

4647
tasks {
4748

48-
compileJava {
49-
options.compilerArgs.addAll(arrayOf("-Xmaxerrs", "1000"))
50-
options.compilerArgs.add("-Xlint:all")
51-
for (disabledLint in arrayOf("processing", "path", "fallthrough", "serial"))
52-
options.compilerArgs.add("-Xlint:$disabledLint")
53-
options.isDeprecation = true
54-
options.encoding = "UTF-8"
55-
}
56-
5749
javadoc {
5850
val opt = options as StandardJavadocDocletOptions
59-
opt.addStringOption("Xdoclint:none", "-quiet")
60-
opt.tags(
61-
"apiNote:a:API Note:",
62-
"implSpec:a:Implementation Requirements:",
63-
"implNote:a:Implementation Note:"
64-
)
65-
opt.links("https://jd.papermc.io/paper/1.20/")
51+
opt.links("https://jd.papermc.io/paper/1.21.5/")
6652
opt.noTimestamp()
6753
}
6854

@@ -72,10 +58,6 @@ tasks {
7258
}
7359
}
7460

75-
java {
76-
withSourcesJar()
77-
withJavadocJar()
78-
}
7961

8062
signing {
8163
if (!project.hasProperty("skip.signing") && !version.toString().endsWith("-SNAPSHOT")) {
@@ -87,53 +69,50 @@ signing {
8769
}
8870
}
8971

90-
publishing {
91-
publications {
92-
create<MavenPublication>("maven") {
93-
from(components["java"])
94-
95-
pom {
96-
97-
name.set(project.name + " " + project.version)
98-
description.set("The API for Head Database, a Minecraft plugin that allows you to obtain thousands of custom Minecraft skulls that feature unique designs.")
99-
url.set("https://github.com/Arcaniax-Development/HeadDatabase-API")
100-
101-
licenses {
102-
license {
103-
name.set("GNU General Public License, Version 3.0")
104-
url.set("https://www.gnu.org/licenses/gpl-3.0.html")
105-
distribution.set("repo")
106-
}
107-
}
108-
109-
developers {
110-
developer {
111-
id.set("Arcaniax")
112-
name.set("Arcaniax")
113-
}
114-
}
115-
116-
scm {
117-
url.set("https://github.com/Arcaniax-Development/HeadDatabase-API")
118-
connection.set("scm:git:https://github.com/Arcaniax-Development/HeadDatabase-API.git")
119-
developerConnection.set("scm:git:git@github.com:Arcaniax-Development/HeadDatabase-API.git")
120-
tag.set("${project.version}")
121-
}
122-
123-
issueManagement {
124-
system.set("GitHub")
125-
url.set("https://github.com/Arcaniax-Development/HeadDatabase-API/issues")
126-
}
72+
mavenPublishing {
73+
coordinates(
74+
groupId = "$group",
75+
artifactId = project.name,
76+
version = "${project.version}",
77+
)
78+
79+
pom {
80+
name.set(project.name)
81+
description.set("The API for Head Database, a Minecraft plugin that allows you to obtain thousands of custom Minecraft skulls that feature unique designs.")
82+
url.set("https://github.com/Arcaniax-Development/HeadDatabase-API")
83+
84+
licenses {
85+
license {
86+
name.set("MIT")
87+
url.set("https://opensource.org/licenses/mit")
88+
distribution.set("repo")
12789
}
12890
}
129-
}
130-
}
13191

132-
nexusPublishing {
133-
repositories {
134-
sonatype {
135-
nexusUrl.set(URI.create("https://s01.oss.sonatype.org/service/local/"))
136-
snapshotRepositoryUrl.set(URI.create("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
92+
developers {
93+
developer {
94+
id.set("Arcaniax")
95+
name.set("Arcaniax")
96+
}
97+
developer {
98+
id.set("NotMyFault")
99+
name.set("NotMyFault")
100+
email.set("contact(at)notmyfault.dev")
101+
}
102+
}
103+
104+
scm {
105+
url.set("https://github.com/Arcaniax-Development/HeadDatabase-API")
106+
connection.set("scm:git:https://github.com/Arcaniax-Development/HeadDatabase-API.git")
107+
developerConnection.set("scm:git:git@github.com:Arcaniax-Development/HeadDatabase-API.git")
108+
tag.set(project.version.toString())
137109
}
110+
111+
issueManagement {
112+
system.set("GitHub")
113+
url.set("https://github.com/Arcaniax-Development/HeadDatabase-API/issues")
114+
}
115+
116+
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
138117
}
139118
}

0 commit comments

Comments
 (0)