File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333 GPG_SIGNING_KEY_ID : ${{ secrets.GPG_SIGNING_KEY_ID }}
3434 GPG_SIGNING_KEY : ${{ secrets.GPG_SIGNING_KEY }}
3535 GPG_SIGNING_PASSWORD : ${{ secrets.GPG_SIGNING_PASSWORD }}
36- MAVEN_USERNAME : ${{ secrets.MAVEN_USERNAME }}
37- MAVEN_PASSWORD : ${{ secrets.MAVEN_PASSWORD }}
36+ SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME || secrets.MAVEN_USERNAME }}
37+ SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD || secrets.MAVEN_PASSWORD }}
Original file line number Diff line number Diff line change @@ -45,21 +45,24 @@ tasks.named<Test>("test") {
4545 useJUnitPlatform()
4646}
4747
48- val mavenUsername = System .getenv(" MAVEN_USERNAME" )
49- val mavenPassword = System .getenv(" MAVEN_PASSWORD" )
50- if (mavenUsername != null && mavenPassword != null ) {
48+ val sonatypeUsername = System .getenv( " SONATYPE_USERNAME " ) ? : System .getenv(" MAVEN_USERNAME" )
49+ val sonatypePassword = System .getenv( " SONATYPE_PASSWORD " ) ? : System .getenv(" MAVEN_PASSWORD" )
50+ if (sonatypeUsername != null && sonatypePassword != null ) {
5151 nexusPublishing {
5252 repositories {
5353 sonatype {
54- nexusUrl = uri(" https://s01.oss.sonatype.org/service/local/" )
55- snapshotRepositoryUrl = uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" )
56- username = mavenUsername
57- password = mavenPassword
54+ // Route through Central Portal's OSSRH Staging API compatibility service.
55+ nexusUrl = uri(" https://ossrh-staging-api.central.sonatype.com/service/local/" )
56+ snapshotRepositoryUrl = uri(" https://central.sonatype.com/repository/maven-snapshots/" )
57+ username = sonatypeUsername
58+ password = sonatypePassword
5859 }
5960 }
6061 }
61- } else if (mavenUsername != null || mavenPassword != null ) {
62- throw GradleException (" missing MAVEN_USERNAME or MAVEN_PASSWORD!" )
62+ } else if (sonatypeUsername != null || sonatypePassword != null ) {
63+ throw GradleException (
64+ " missing SONATYPE_USERNAME or SONATYPE_PASSWORD (legacy MAVEN_USERNAME/MAVEN_PASSWORD is still supported)!" ,
65+ )
6366}
6467
6568publishing {
You can’t perform that action at this time.
0 commit comments