@@ -5,6 +5,7 @@ plugins {
55 id " signing"
66 id " com.github.spotbugs" version " 6.4.8"
77 id " org.sonarqube" version " 2.7.1"
8+ id " org.jreleaser" version " 1.22.0"
89}
910
1011group = " io.github.ari4java"
@@ -46,7 +47,7 @@ dependencies {
4647 testImplementation ' org.junit.jupiter:junit-jupiter-api:5.8.2'
4748 testRuntimeOnly ' org.junit.jupiter:junit-jupiter-engine:5.8.2'
4849 testImplementation ' org.mockito:mockito-core:4.2.0'
49- testImplementation ' ch.qos.logback:logback-classic:1.5.25 '
50+ testImplementation ' ch.qos.logback:logback-classic:1.5.26 '
5051}
5152
5253tasks. register(' buildProps' , WriteProperties ) {
@@ -112,6 +113,22 @@ jacocoTestCoverageVerification {
112113 }
113114}
114115
116+ spotbugsMain {
117+ excludeFilter = file(" spotbugs-exclude.xml" )
118+ reports {
119+ xml. required. set(true )
120+ html. required. set(true )
121+ }
122+ }
123+
124+ spotbugsTest {
125+ ignoreFailures = true
126+ reports {
127+ xml. required. set(false )
128+ html. required. set(true )
129+ }
130+ }
131+
115132sonarqube {
116133 properties {
117134 property " sonar.projectKey" , " ari4java"
@@ -157,37 +174,33 @@ publishing {
157174 }
158175 repositories {
159176 maven {
160- name = " sonatype"
161- url = " https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
162- credentials {
163- username = System . getenv(" SONATYPE_USER" )
164- password = System . getenv(" SONATYPE_PASS" )
165- }
177+ name = " staging-deploy"
178+ url = layout. buildDirectory. dir(" staging-deploy" )
166179 }
167180 }
168181
169182}
170183
171- signing {
172- def signingKeyId = System . getenv(" PGP_ID" )
173- def signingKey = System . getenv(" PGP_KEY" )
174- def signingPassword = System . getenv(" PGP_PASS" )
175- useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
176- sign publishing. publications
177- }
178-
179- spotbugsMain {
180- excludeFilter = file(" spotbugs-exclude.xml" )
181- reports {
182- xml. required. set(true )
183- html. required. set(true )
184+ jreleaser {
185+ signing {
186+ active = " ALWAYS"
187+ armored = true
188+ // Keys via Environment Variables:
189+ // JRELEASER_GPG_SECRET_KEY JRELEASER_GPG_PASSPHRASE JRELEASER_GPG_PUBLIC_KEY
184190 }
185- }
186-
187- spotbugsTest {
188- ignoreFailures = true
189- reports {
190- xml. required. set(false )
191- html. required. set(true )
191+ deploy {
192+ maven {
193+ mavenCentral {
194+ sonatype {
195+ active = " ALWAYS"
196+ url = " https://central.sonatype.com/api/v1/publisher"
197+ authorization = " BASIC"
198+ // user & pass via Environment Variables:
199+ // JRELEASER_MAVENCENTRAL_SONATYPE_USERNAME JRELEASER_MAVENCENTRAL_SONATYPE_PASSWORD
200+ applyMavenCentralRules = true
201+ stagingRepository(" build/staging-deploy" )
202+ }
203+ }
204+ }
192205 }
193206}
0 commit comments