File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,20 @@ nexusStaging {
96
96
numberOfRetries = 100 // Increase number of retries
97
97
delayBetweenRetriesInMillis = 10000 // 10 seconds
98
98
}
99
+ tasks. publish. doLast {
100
+ def stagingPlugin = project. plugins. findPlugin(NexusStagingPlugin )
101
+ def stagingManager = stagingPlugin. getStagingManager()
102
+ def stagingRepositories = stagingManager. getOpenRepositories()
103
+ if (stagingRepositories. size() == 1 ) {
104
+ project. ext. stagingRepositoryId = stagingRepositories[0 ]. repositoryId
105
+ } else {
106
+ throw new GradleException (" Expected exactly one open staging repository, but found ${ stagingRepositories.size()} " )
107
+ }
108
+ }
109
+
110
+ closeAndReleaseRepository {
111
+ stagingRepositoryId = project. ext. stagingRepositoryId
112
+ }
99
113
publishing {
100
114
101
115
repositories {
Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ echo "app.version=$VERSION_SEMVER" >./src/main/resources/com/neuronrobotics/java
11
11
./gradlew publish -Psigning.secretKeyRingFile=$HOME /.gnupg/secring.gpg -Psigning.password=$OSSRH_GPG_SECRET_KEY_PASSWORD -Psigning.keyId=$OSSRH_GPG_SECRET_KEY_ID -PstagingProgressTimeoutMinutes=15
12
12
13
13
# close and release Sonatype
14
- # ./gradlew closeAndReleaseRepository -PnexusUsername=$MAVEN_USERNAME -PnexusPassword=$MAVEN_PASSWORD
15
- echo " Closing Repository"
16
- ./gradlew closeRepository -PnexusUsername=$MAVEN_USERNAME -PnexusPassword=$MAVEN_PASSWORD
17
- echo " Releasing repository"
18
- ./gradlew releaseRepository -PnexusUsername=$MAVEN_USERNAME -PnexusPassword=$MAVEN_PASSWORD
14
+ ./gradlew closeAndReleaseRepository -PnexusUsername=$MAVEN_USERNAME -PnexusPassword=$MAVEN_PASSWORD
15
+ # echo "Closing Repository"
16
+ # ./gradlew closeRepository -PnexusUsername=$MAVEN_USERNAME -PnexusPassword=$MAVEN_PASSWORD
17
+ # echo "Releasing repository"
18
+ # ./gradlew releaseRepository -PnexusUsername=$MAVEN_USERNAME -PnexusPassword=$MAVEN_PASSWORD
19
19
You can’t perform that action at this time.
0 commit comments