Skip to content

Commit 207ae7d

Browse files
committed
Publish by using Portal OSSRH Staging API
Updates the current release process to publish artifacts to the Sonatype Central Portal instead of Sonatype OSSRH using their staging API that is intended to reduce friction while migrating.
1 parent 4a5876d commit 207ae7d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

build.gradle

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,14 @@ subprojects {
314314
}
315315
repositories {
316316
maven {
317-
def ossrhRelease = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
318-
def ossrhSnapshot = "https://oss.sonatype.org/content/repositories/snapshots/"
317+
// Publish using Portal OSSRH Staging API.
318+
// For more information see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#publishing-by-using-the-portal-ossrh-staging-api
319+
def ossrhRelease = "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
320+
def ossrhSnapshot = "https://central.sonatype.com/repository/maven-snapshots/"
319321
url = isReleaseVersion ? ossrhRelease : ossrhSnapshot
320322
credentials {
321-
username = rootProject.hasProperty('ossrhUsername') ? rootProject.ossrhUsername : "Unknown user"
322-
password = rootProject.hasProperty('ossrhPassword') ? rootProject.ossrhPassword : "Unknown password"
323+
username = rootProject.hasProperty('centralPortalUsername') ? rootProject.centralPortalUsername : "Unknown user"
324+
password = rootProject.hasProperty('centralPortalPassword') ? rootProject.centralPortalPassword : "Unknown password"
323325
}
324326
}
325327
}

0 commit comments

Comments
 (0)