@@ -4,8 +4,8 @@ plugins {
4
4
id ' com.diffplug.spotless' version ' 6.25.0'
5
5
id ' signing'
6
6
id ' maven-publish'
7
- id ' net.researchgate.release' version ' 3.0.2'
8
7
id ' io.github.gradle-nexus.publish-plugin' version ' 1.3.0'
8
+ id ' net.researchgate.release' version ' 3.0.2'
9
9
}
10
10
11
11
wrapper {
@@ -67,8 +67,8 @@ nexusPublishing {
67
67
repositories {
68
68
sonatype {
69
69
nexusUrl. set(uri(" https://oss.sonatype.org/service/local/" ))
70
- username = project. findProperty(' sonatypeUser ' ) ?: ' '
71
- password = project. findProperty(' sonatypePassword ' ) ?: ' '
70
+ username = project. findProperty(' ossSonatypeUsername ' ) ?: ' '
71
+ password = project. findProperty(' ossSonatypePassword ' ) ?: ' '
72
72
}
73
73
}
74
74
}
@@ -115,22 +115,13 @@ publishing {
115
115
}
116
116
117
117
release {
118
- buildTasks = [' releaseBuild ' ]
118
+ buildTasks = [' doRelease ' ]
119
119
git {
120
120
requireBranch. set(' 6.x' )
121
121
}
122
122
}
123
123
124
- task releaseBuild {
125
- dependsOn(
126
- ' checkLastVersionValue' ,
127
- ' clean' ,
128
- ' build' ,
129
- project. getTasksByName(' publishToSonatype' , true )
130
- )
131
- }
132
-
133
- tasks. register(' checkLastVersionValue' ) {
124
+ def checkLastVersionValueTask = tasks. register(' checkLastVersionValue' ) {
134
125
doLast {
135
126
if (version. endsWith(' SNAPSHOT' )) {
136
127
throw new GradleException (" version '$version ' ends with SNAPSHOT, this is not a release build!" )
@@ -151,6 +142,16 @@ def updateLastVersionValueTask = tasks.register('updateLastVersionValue') {
151
142
}
152
143
}
153
144
145
+ tasks. register(' doRelease' ) {
146
+ dependsOn(
147
+ checkLastVersionValueTask,
148
+ ' initializeSonatypeStagingRepository' ,
149
+ ' clean' ,
150
+ ' build' ,
151
+ project. getTasksByName(' publishToSonatype' , true )
152
+ )
153
+ }
154
+
154
155
model {
155
156
tasks. unSnapshotVersion {
156
157
dependsOn updateLastVersionValueTask
0 commit comments