12
12
* express or implied. See the License for the specific language governing
13
13
* permissions and limitations under the License.
14
14
*/
15
+
16
+ import org.jreleaser.model.Active
17
+
15
18
plugins {
16
19
`java- library`
17
20
`maven- publish`
18
21
signing
19
22
checkstyle
20
23
jacoco
21
24
id(" com.github.spotbugs" ) version " 4.7.1"
22
- id(" io.codearte.nexus-staging " ) version " 0.30 .0"
25
+ id(" org.jreleaser " ) version " 1.9 .0"
23
26
}
24
27
25
28
allprojects {
@@ -38,27 +41,6 @@ tasks["jar"].enabled = false
38
41
val sonatypeUser: String? by project
39
42
val sonatypePassword: String? by project
40
43
41
- /*
42
- * Sonatype Staging Finalization
43
- * ====================================================
44
- *
45
- * When publishing to Maven Central, we need to close the staging
46
- * repository and release the artifacts after they have been
47
- * validated. This configuration is for the root project because
48
- * it operates at the "group" level.
49
- */
50
- if (sonatypeUser != null && sonatypePassword != null ) {
51
- apply (plugin = " io.codearte.nexus-staging" )
52
-
53
- nexusStaging {
54
- packageGroup = " software.amazon"
55
- stagingProfileId = " e789115b6c941"
56
-
57
- username = sonatypeUser
58
- password = sonatypePassword
59
- }
60
- }
61
-
62
44
repositories {
63
45
mavenLocal()
64
46
mavenCentral()
@@ -141,12 +123,9 @@ subprojects {
141
123
142
124
publishing {
143
125
repositories {
144
- mavenCentral {
145
- url = uri(" https://aws.oss.sonatype.org/service/local/staging/deploy/maven2/" )
146
- credentials {
147
- username = sonatypeUser
148
- password = sonatypePassword
149
- }
126
+ maven {
127
+ name = " stagingRepository"
128
+ url = uri(" ${rootProject.buildDir} /staging" )
150
129
}
151
130
}
152
131
@@ -265,3 +244,51 @@ subprojects {
265
244
}
266
245
}
267
246
}
247
+
248
+ /*
249
+ * Jreleaser (https://jreleaser.org) config.
250
+ */
251
+ jreleaser {
252
+ dryrun = false
253
+
254
+ // Used for creating a tagged release, uploading files and generating changelog.
255
+ // In the future we can set this up to push release tags to GitHub, but for now it's
256
+ // set up to do nothing.
257
+ // https://jreleaser.org/guide/latest/reference/release/index.html
258
+ release {
259
+ generic {
260
+ enabled = true
261
+ skipRelease = true
262
+ }
263
+ }
264
+
265
+ // Used to announce a release to configured announcers.
266
+ // https://jreleaser.org/guide/latest/reference/announce/index.html
267
+ announce {
268
+ active = Active .NEVER
269
+ }
270
+
271
+ // Signing configuration.
272
+ // https://jreleaser.org/guide/latest/reference/signing.html
273
+ signing {
274
+ active = Active .ALWAYS
275
+ armored = true
276
+ }
277
+
278
+ // Configuration for deploying to Maven Central.
279
+ // https://jreleaser.org/guide/latest/examples/maven/maven-central.html#_gradle
280
+ deploy {
281
+ maven {
282
+ nexus2 {
283
+ create(" maven-central" ) {
284
+ active = Active .ALWAYS
285
+ url = " https://aws.oss.sonatype.org/service/local"
286
+ snapshotUrl = " https://aws.oss.sonatype.org/content/repositories/snapshots"
287
+ closeRepository.set(true )
288
+ releaseRepository.set(true )
289
+ stagingRepositories.add(" ${rootProject.buildDir} /staging" )
290
+ }
291
+ }
292
+ }
293
+ }
294
+ }
0 commit comments