22ext[" signing.keyId" ] = ' '
33ext[" signing.password" ] = ' '
44ext[" signing.key" ] = ' '
5- ext[" ossrhUsername " ] = ' '
6- ext[" ossrhPassword " ] = ' '
5+ ext[" centralUsername " ] = ' '
6+ ext[" centralPassword " ] = ' '
77ext[" sonatypeStagingProfileId" ] = ' '
88
99File secretPropsFile = project. rootProject. file(' local.properties' )
@@ -15,24 +15,26 @@ if (secretPropsFile.exists()) {
1515 p. each { name , value -> ext[name] = value }
1616} else {
1717 // Use system environment variables
18- ext[" ossrhUsername" ] = System . getenv(' OSSRH_USERNAME' )
19- ext[" ossrhPassword" ] = System . getenv(' OSSRH_PASSWORD' )
18+ // For Central Portal, use token as password (username is your Sonatype account username)
19+ ext[" centralUsername" ] = System . getenv(' CENTRAL_USERNAME' ) ?: System . getenv(' OSSRH_USERNAME' )
20+ ext[" centralPassword" ] = System . getenv(' CENTRAL_PASSWORD' ) ?: System . getenv(' OSSRH_PASSWORD' )
2021 ext[" sonatypeStagingProfileId" ] = System . getenv(' SONATYPE_STAGING_PROFILE_ID' )
2122 ext[" signing.keyId" ] = System . getenv(' SIGNING_KEY_ID' )
2223 ext[" signing.password" ] = System . getenv(' SIGNING_PASSWORD' )
2324 ext[" signing.key" ] = System . getenv(' SIGNING_KEY' )
2425}
2526
26- // Set up Sonatype repository
27+ // Set up Central Portal repository
2728nexusPublishing {
2829 repositories {
2930 sonatype {
3031 stagingProfileId = sonatypeStagingProfileId
31- username = ossrhUsername
32- password = ossrhPassword
32+ username = centralUsername
33+ password = centralPassword
3334
34- nexusUrl. set(uri(" https://s01.oss.sonatype.org/service/local/" ))
35- snapshotRepositoryUrl. set(uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" ))
35+ // Central Portal endpoints
36+ nexusUrl. set(uri(" https://central.sonatype.com/" ))
37+ snapshotRepositoryUrl. set(uri(" https://central.sonatype.com/content/repositories/snapshots/" ))
3638 }
3739 }
3840}
0 commit comments