Skip to content

Commit 55699da

Browse files
committed
Migrated from OSSRH to Portal OSSRH Staging API
OSSRH was sunset recently. Now using Portal OSSRH Staging API for publishing on Maven Central.
1 parent 1c442e4 commit 55699da

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

.github/workflows/publish-maven-central.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ jobs:
3535
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
3636
run: |
3737
./gradlew --info --stacktrace -Psigning.secretKeyRingFile=$HOME/.gnupg/secring.gpg -Psigning.password="$GPG_PASSPHRASE" -P signing.keyId=${{ secrets.GPG_KEY_ID }} publish
38+
curl -u ${{ secrets.SONATYPE_USER }}:${{ secrets.SONATYPE_PASSWORD }} -X POST https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/org.jcommander
3839
3940
- name: Display next step
4041
run: |
41-
echo "Now go to https://s01.oss.sonatype.org/index.html#stagingRepositories, select the repo, Close it and then Release it"
42+
echo "Now go to https://central.sonatype.com/publishing/deployments, select the repo, Close it and then Release it"

build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ tasks.withType<Test> {
9393

9494
//
9595
// Releases:
96-
// ./gradlew publish (to Sonatype, then go to https://s01.oss.sonatype.org/index.html#stagingRepositories to publish)
96+
// ./gradlew publish (to Sonatype, then go to https://central.sonatype.com/publishing/deployments to publish)
9797
// Make sure that ~/.gradle/gradle.properties:
9898
// signing.keyId=XXXXXXXX
9999
// signing.password=
@@ -159,8 +159,8 @@ with(publishing) {
159159
maven {
160160
name = "sonatype"
161161
url = if (This.version.contains("SNAPSHOT"))
162-
uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") else
163-
uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
162+
uri("https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots/") else
163+
uri("https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/")
164164
credentials {
165165
username = project.findProperty("sonatypeUser")?.toString() ?: System.getenv("SONATYPE_USER")
166166
password = project.findProperty("sonatypePassword")?.toString() ?: System.getenv("SONATYPE_PASSWORD")

gradle/publishing-maven.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ uploadArchives {
4242
mavenDeployer {
4343
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
4444

45-
repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2") {
45+
repository(url: "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2") {
4646
authentication(userName: System.getenv('SONATYPE_USER'), password: System.getenv('SONATYPE_PASSWORD'))
4747
}
48-
snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots") {
48+
snapshotRepository(url: "https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots") {
4949
authentication(userName: System.getenv('SONATYPE_USER'), password: System.getenv('SONATYPE_PASSWORD'))
5050
}
5151
pom {
@@ -82,7 +82,7 @@ uploadArchives {
8282

8383
uploadArchives.doLast {
8484
if (! version.contains("SNAPSHOT")) {
85-
println("Now go to https://s01.oss.sonatype.org/index.html#stagingRepositories to close" +
85+
println("Now go to https://central.sonatype.com/publishing/deployments to close" +
8686
" and publish the distribution")
8787
}
8888
}

release

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# UI : https://s01.oss.sonatype.org/index.html
2-
# Wiki: https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide
1+
# UI : https://central.sonatype.com/publishing/deployments
2+
# Wiki: https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/
33
#
44
# deploy without tagging: mvn deploy -DperformRelease
55
# mvn release:clean javadoc:javadoc release:prepare release:perform

0 commit comments

Comments
 (0)