1+ import com.vanniktech.maven.publish.JavaLibrary
2+ import com.vanniktech.maven.publish.JavadocJar
3+ import com.vanniktech.maven.publish.SonatypeHost
4+
15plugins {
2- id ' io.codearte.nexus-staging' version ' 0.30.0' // logs into Sonotype OSS and does a "Close" and "Release"
3- id ' com.github.spotbugs' version ' 6.0.15'
6+ id ' com.github.spotbugs' version ' 6.1.11'
47 id ' com.adarshr.test-logger' version ' 4.0.0'
5- id ' com.github.ben-manes.versions' version ' 0.51.0'
6- id ' org.sonatype.gradle.plugins.scan' version ' 2.8.2'
7- id ' org.sonarqube' version ' 5.0.0.4638'
8+ id ' com.github.ben-manes.versions' version ' 0.52.0'
9+ id ' org.sonatype.gradle.plugins.scan' version ' 3.1.1'
10+ id ' org.sonarqube' version ' 6.1.0.5360'
11+ id ' com.vanniktech.maven.publish' version ' 0.31.0'
812}
913
1014sonarqube {
@@ -18,39 +22,31 @@ sonarqube {
1822 }
1923}
2024
21- // configure nexus staging plugin
22- nexusStaging {
23- numberOfRetries = 50
24- delayBetweenRetriesInMillis = 5000
25- packageGroup = ' com.imsweb'
26- }
27-
28- // don't try to release a snapshot to a non-snapshot repository, that won't work anyway
29- if (version. endsWith(' -SNAPSHOT' )) {
30- gradle. startParameter. excludedTaskNames + = ' closeAndReleaseRepository'
31- }
32-
3325subprojects {
3426 apply plugin : ' java-library'
35- apply plugin : " com.github.spotbugs"
27+ apply plugin : ' com.github.spotbugs'
3628 apply plugin : ' jacoco'
3729 apply plugin : ' maven-publish'
3830 apply plugin : ' signing'
3931 apply plugin : ' com.adarshr.test-logger'
40- apply plugin : " com.github.ben-manes.versions"
32+ apply plugin : ' com.github.ben-manes.versions'
4133 apply plugin : ' org.sonatype.gradle.plugins.scan'
42- apply plugin : " org.sonarqube"
34+ apply plugin : ' org.sonarqube'
35+ apply plugin : ' com.vanniktech.maven.publish'
4336
4437 group = ' com.imsweb'
45- version = ' 11.3.2 '
38+ version = ' 11.4.0-SNAPSHOT '
4639
4740 dependencies {
48- testImplementation ' org.junit.jupiter:junit-jupiter-api:5.10.2'
49- testImplementation ' org.junit.jupiter:junit-jupiter-params:5.10.2'
50- testRuntimeOnly ' org.junit.jupiter:junit-jupiter-engine:5.10.2'
51- testImplementation ' org.assertj:assertj-core:3.26.0'
41+ testImplementation platform(' org.junit:junit-bom:5.12.2' )
42+ testImplementation ' org.junit.jupiter:junit-jupiter-api'
43+ testImplementation ' org.junit.jupiter:junit-jupiter-params'
44+ testRuntimeOnly ' org.junit.jupiter:junit-jupiter-engine'
45+ testRuntimeOnly ' org.junit.platform:junit-platform-launcher:1.12.2'
46+
47+ testImplementation ' org.assertj:assertj-core:3.27.3'
5248 testImplementation ' com.google.code.bean-matchers:bean-matchers:0.14'
53- testImplementation ' org.slf4j:slf4j-simple:2.0.13 '
49+ testImplementation ' org.slf4j:slf4j-simple:2.0.17 '
5450 }
5551
5652 // fail the build if there are compiler warnings
@@ -62,9 +58,6 @@ subprojects {
6258 java {
6359 sourceCompatibility = JavaVersion . VERSION_1_8
6460 targetCompatibility = JavaVersion . VERSION_1_8
65-
66- withJavadocJar()
67- withSourcesJar()
6861 }
6962
7063 repositories {
@@ -134,79 +127,44 @@ subprojects {
134127 classpath = sourceSets. test. runtimeClasspath
135128 }
136129
137- // don't try to sign a snapshot; its not needed
138- if (version. endsWith(' -SNAPSHOT' )) {
139- gradle. startParameter. excludedTaskNames + = ' signMavenJavaPublication'
140- }
130+ mavenPublishing {
131+ configure(new JavaLibrary (new JavadocJar.Javadoc (), true ))
141132
142- publishing {
143- publications {
144- mavenJava(MavenPublication ) {
145- artifactId = project. name
146- from components. java
147- versionMapping {
148- usage(' java-api' ) {
149- fromResolutionOf(' runtimeClasspath' )
150- }
151- usage(' java-runtime' ) {
152- fromResolutionResult()
153- }
154- }
155- pom {
156- name = ' Staging Java Client'
157- description = ' A cancer staging client library'
158- url = ' https://github.com/imsweb/staging-client-java'
159- inceptionYear = ' 2015'
160-
161- licenses {
162- license {
163- name = ' A modified BSD License (BSD)'
164- url = ' https://github.com/imsweb/staging-client-java/blob/master/LICENSE'
165- distribution = ' repo'
166- }
167- }
168-
169- developers {
170- developer {
171- id = ' ctmay4'
172- name = ' Chuck May'
173- 174- }
175- }
176-
177- scm {
178- url = ' https://github.com/imsweb/staging-client-java'
179- connection = ' scm:https://github.com/imsweb/staging-client-java.git'
180- developerConnection
= ' scm:[email protected] :imsweb/staging-client-java.git' 181- }
133+ publishToMavenCentral(SonatypeHost . CENTRAL_PORTAL , true )
134+ signAllPublications()
135+
136+ pom {
137+ name = ' Staging Java Client'
138+ description = ' A cancer staging client library'
139+ url = ' https://github.com/imsweb/staging-client-java'
140+ inceptionYear = ' 2015'
141+
142+ licenses {
143+ license {
144+ name = ' A modified BSD License (BSD)'
145+ url = ' https://github.com/imsweb/staging-client-java/blob/master/LICENSE'
146+ distribution = ' repo'
182147 }
183148 }
184- }
185- repositories {
186- maven {
187- def releasesRepoUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2"
188- def snapshotsRepoUrl = " https://oss.sonatype.org/content/repositories/snapshots"
189- url = version. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
190-
191- credentials {
192- username = project. findProperty(' nexusUsername' ) ?: ' '
193- password = project. findProperty(' nexusPassword' ) ?: ' '
149+
150+ developers {
151+ developer {
152+ id = ' ctmay4'
153+ name = ' Chuck May'
154+ 194155 }
195156 }
157+
158+ scm {
159+ url = ' https://github.com/imsweb/staging-client-java'
160+ connection = ' scm:https://github.com/imsweb/staging-client-java.git'
161+ developerConnection
= ' scm:[email protected] :imsweb/staging-client-java.git' 162+ }
196163 }
197164 }
198165
199- signing {
200- def signingKey = project. findProperty(' signingKey' ) ?: ' '
201- def signingPassword = project. findProperty(' signingPassword' ) ?: ' '
202-
203- useInMemoryPgpKeys(signingKey, signingPassword)
204-
205- sign publishing. publications. mavenJava
166+ wrapper {
167+ gradleVersion = ' 8.14'
168+ distributionType = Wrapper.DistributionType . ALL
206169 }
207- }
208-
209- wrapper {
210- gradleVersion = ' 8.8'
211- distributionType = Wrapper.DistributionType . ALL
212170}
0 commit comments