Skip to content

Commit 8a3728d

Browse files
committed
publish via the Central Publisher Portal instead of OSSRH
1 parent c3600ec commit 8a3728d

4 files changed

Lines changed: 23 additions & 23 deletions

File tree

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ tasks.register("install") {
2020
}
2121
tasks.register("release") {
2222
dependsOn("library:release", "vorbis:release")
23-
description = "Stages Maven artifacts to Sonatype OSSRH."
23+
description = "Stages the Maven artifacts to the Central Publisher Portal."
2424
}

library/build.gradle.kts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ tasks.register("install") {
6464
description = "Installs the Maven artifacts to the local repository."
6565
}
6666
tasks.register("release") {
67-
dependsOn("publishMavenPublicationToOSSRHRepository")
68-
description = "Stages the Maven artifacts to Sonatype OSSRH."
67+
dependsOn("publishMavenPublicationToCentralRepository")
68+
description = "Stages the Maven artifacts to the Central Publisher Portal."
6969
}
7070

7171
tasks.jar {
@@ -150,17 +150,18 @@ publishing {
150150
version = libraryVersion
151151
}
152152
}
153-
// Staging to OSSRH relies on the existence of 2 properties
154-
// (ossrhUsername and ossrhPassword)
155-
// which should be stored in ~/.gradle/gradle.properties
153+
// Staging to the Central Publisher Portal relies on the existence of 2 properties
154+
// (centralUsername and centralPassword)
155+
// which should be set in the ~/.gradle/gradle.properties file
156+
// or by -P options on the command line.
156157
repositories {
157158
maven {
158159
credentials {
159-
username = if (hasProperty("ossrhUsername")) property("ossrhUsername") as String else "Unknown user"
160-
password = if (hasProperty("ossrhPassword")) property("ossrhPassword") as String else "Unknown password"
160+
username = if (hasProperty("centralUsername")) property("centralUsername") as String else "Unknown user"
161+
password = if (hasProperty("centralPassword")) property("centralPassword") as String else "Unknown password"
161162
}
162-
name = "OSSRH"
163-
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2")
163+
name = "Central"
164+
url = uri("https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/")
164165
}
165166
}
166167
}
@@ -169,7 +170,7 @@ tasks.named("publishMavenPublicationToMavenLocal") {
169170
dependsOn("assemble")
170171
doLast { println("installed locally as " + baseName) }
171172
}
172-
tasks.named("publishMavenPublicationToOSSRHRepository") { dependsOn("assemble") }
173+
tasks.named("publishMavenPublicationToCentralRepository") { dependsOn("assemble") }
173174

174175
// Register signing tasks:
175176

settings.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ dependencyResolutionManagement {
66
repositories {
77
//mavenLocal() // to find libraries installed locally
88
mavenCentral() // to find libraries released to the Maven Central repository
9-
//maven { url = uri("https://s01.oss.sonatype.org/content/groups/staging") } // to find libraries staged but not yet released
10-
//maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots") } // to find public snapshots of libraries
119
}
1210
}
1311

vorbis/build.gradle.kts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ tasks.register("install") {
5454
description = "Installs the Maven artifacts to the local repository."
5555
}
5656
tasks.register("release") {
57-
dependsOn("publishMavenPublicationToOSSRHRepository")
58-
description = "Stages the Maven artifacts to Sonatype OSSRH."
57+
dependsOn("publishMavenPublicationToCentralRepository")
58+
description = "Stages the Maven artifacts to the Central Publisher Portal."
5959
}
6060

6161
tasks.jar {
@@ -140,17 +140,18 @@ publishing {
140140
version = libraryVersion
141141
}
142142
}
143-
// Staging to OSSRH relies on the existence of 2 properties
144-
// (ossrhUsername and ossrhPassword)
145-
// which should be stored in ~/.gradle/gradle.properties
143+
// Staging to the Central Publisher Portal relies on the existence of 2 properties
144+
// (centralUsername and centralPassword)
145+
// which should be set in the ~/.gradle/gradle.properties file
146+
// or by -P options on the command line.
146147
repositories {
147148
maven {
148149
credentials {
149-
username = if (hasProperty("ossrhUsername")) property("ossrhUsername") as String else "Unknown user"
150-
password = if (hasProperty("ossrhPassword")) property("ossrhPassword") as String else "Unknown password"
150+
username = if (hasProperty("centralUsername")) property("centralUsername") as String else "Unknown user"
151+
password = if (hasProperty("centralPassword")) property("centralPassword") as String else "Unknown password"
151152
}
152-
name = "OSSRH"
153-
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2")
153+
name = "Central"
154+
url = uri("https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/")
154155
}
155156
}
156157
}
@@ -159,7 +160,7 @@ tasks.named("publishMavenPublicationToMavenLocal") {
159160
dependsOn("assemble")
160161
doLast { println("installed locally as " + baseName) }
161162
}
162-
tasks.named("publishMavenPublicationToOSSRHRepository") { dependsOn("assemble") }
163+
tasks.named("publishMavenPublicationToCentralRepository") { dependsOn("assemble") }
163164

164165
// Register signing tasks:
165166

0 commit comments

Comments
 (0)