@@ -11,7 +11,7 @@ plugins {
1111 // https://github.com/spotbugs/spotbugs-gradle-plugin/releases
1212 id(" com.github.spotbugs" ) version " 6.0.26" apply false
1313 // https://github.com/gradle-nexus/publish-plugin/releases
14- id(" io.github.gradle-nexus.publish-plugin" ) version " 1.3 .0"
14+ id(" io.github.gradle-nexus.publish-plugin" ) version " 2.0 .0"
1515}
1616
1717buildscript {
@@ -118,22 +118,23 @@ tasks.wrapper {
118118 distributionType = Wrapper .DistributionType .ALL
119119}
120120
121- // Plugin to publish to Central https://github.com/gradle-nexus/publish-plugin/
121+ // Plugin to publish to Maven Central https://github.com/gradle-nexus/publish-plugin/
122122// This plugin ensures a separate, named staging repo is created for each build when publishing.
123- apply (plugin = " io.github.gradle-nexus.publish-plugin" )
124- configure< io.github.gradlenexus.publishplugin.NexusPublishExtension > {
123+ nexusPublishing {
125124 this .repositories {
126125 sonatype {
126+ // Use the Portal OSSRH Staging API as this plugin does not support the new Portal API
127+ // https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuring-your-plugin
128+ nexusUrl.set(uri(" https://ossrh-staging-api.central.sonatype.com/service/local/" ))
129+ snapshotRepositoryUrl.set(uri(" https://central.sonatype.com/repository/maven-snapshots/" ))
130+
127131 if (project.hasProperty(" sonatypeUsername" ) && project.hasProperty(" sonatypePassword" )) {
132+ println (" Publishing: Sonatype Maven Central credentials supplied." )
128133 username.set(project.property(" sonatypeUsername" ).toString())
129134 password.set(project.property(" sonatypePassword" ).toString())
130- println (" Publishing: configured Maven Central repository" )
131135 } else {
132- println (" Publishing: Maven Central repository not configured " )
136+ println (" Publishing: Sonatype Maven Central credentials NOT supplied. " )
133137 }
134138 }
135139 }
136- transitionCheckOptions { // Maven Central may become very, very slow in extreme situations
137- maxRetries.set(900 ) // with default delay of 10s, that's 150 minutes total; default is 60 (10 minutes)
138- }
139140}
0 commit comments