@@ -11,7 +11,7 @@ plugins {
11
11
// https://github.com/spotbugs/spotbugs-gradle-plugin/releases
12
12
id(" com.github.spotbugs" ) version " 6.0.26" apply false
13
13
// 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"
15
15
}
16
16
17
17
buildscript {
@@ -118,22 +118,23 @@ tasks.wrapper {
118
118
distributionType = Wrapper .DistributionType .ALL
119
119
}
120
120
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/
122
122
// 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 {
125
124
this .repositories {
126
125
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
+
127
131
if (project.hasProperty(" sonatypeUsername" ) && project.hasProperty(" sonatypePassword" )) {
132
+ println (" Publishing: Sonatype Maven Central credentials supplied." )
128
133
username.set(project.property(" sonatypeUsername" ).toString())
129
134
password.set(project.property(" sonatypePassword" ).toString())
130
- println (" Publishing: configured Maven Central repository" )
131
135
} else {
132
- println (" Publishing: Maven Central repository not configured " )
136
+ println (" Publishing: Sonatype Maven Central credentials NOT supplied. " )
133
137
}
134
138
}
135
139
}
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
- }
139
140
}
0 commit comments