diff --git a/.github/workflows/cs-comparison.yml b/.github/workflows/cs-comparison.yml index a4976558f..d25b6d647 100644 --- a/.github/workflows/cs-comparison.yml +++ b/.github/workflows/cs-comparison.yml @@ -20,7 +20,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'adopt' - java-version: '17' + java-version: '21' cache: 'gradle' - name: CS Comparison diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 98bf51e1c..9a90c945d 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -19,7 +19,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'adopt' - java-version: '17' + java-version: '21' cache: 'gradle' - name: Cache SonarCloud packages diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e79eb76ab..a39adfaf6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,15 +21,15 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'adopt' - java-version: '17' + java-version: '21' cache: 'gradle' - - name: Publish + - name: Publish to Maven Central (Portal) run: | chmod +x gradlew - ./gradlew publish closeAndReleaseRepository + ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache env: - ORG_GRADLE_PROJECT_nexusUsername: ${{ secrets.NEXUS_USERNAME }} - ORG_GRADLE_PROJECT_nexusPassword: ${{ secrets.NEXUS_PASSWORD }} - ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SEER_GPG_SECRET_KEY }} - ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SEER_GPG_PASSWORD }} + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} diff --git a/.github/workflows/upload-algorithms.yml b/.github/workflows/upload-algorithms.yml index b44abf964..615dc4555 100644 --- a/.github/workflows/upload-algorithms.yml +++ b/.github/workflows/upload-algorithms.yml @@ -21,7 +21,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'adopt' - java-version: '17' + java-version: '21' - name: Create algorithm zips if: ${{startsWith(github.ref, 'refs/tags/v') }} diff --git a/build.gradle b/build.gradle index 473634e7c..f75c06f8e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,14 @@ +import com.vanniktech.maven.publish.JavaLibrary +import com.vanniktech.maven.publish.JavadocJar +import com.vanniktech.maven.publish.SonatypeHost + plugins { - id 'io.codearte.nexus-staging' version '0.30.0' // logs into Sonotype OSS and does a "Close" and "Release" - id 'com.github.spotbugs' version '6.0.15' + id 'com.github.spotbugs' version '6.1.11' id 'com.adarshr.test-logger' version '4.0.0' - id 'com.github.ben-manes.versions' version '0.51.0' - id 'org.sonatype.gradle.plugins.scan' version '2.8.2' - id 'org.sonarqube' version '5.0.0.4638' + id 'com.github.ben-manes.versions' version '0.52.0' + id 'org.sonatype.gradle.plugins.scan' version '3.1.1' + id 'org.sonarqube' version '6.1.0.5360' + id 'com.vanniktech.maven.publish' version '0.31.0' } sonarqube { @@ -18,39 +22,31 @@ sonarqube { } } -// configure nexus staging plugin -nexusStaging { - numberOfRetries = 50 - delayBetweenRetriesInMillis = 5000 - packageGroup = 'com.imsweb' -} - -// don't try to release a snapshot to a non-snapshot repository, that won't work anyway -if (version.endsWith('-SNAPSHOT')) { - gradle.startParameter.excludedTaskNames += 'closeAndReleaseRepository' -} - subprojects { apply plugin: 'java-library' - apply plugin: "com.github.spotbugs" + apply plugin: 'com.github.spotbugs' apply plugin: 'jacoco' apply plugin: 'maven-publish' apply plugin: 'signing' apply plugin: 'com.adarshr.test-logger' - apply plugin: "com.github.ben-manes.versions" + apply plugin: 'com.github.ben-manes.versions' apply plugin: 'org.sonatype.gradle.plugins.scan' - apply plugin: "org.sonarqube" + apply plugin: 'org.sonarqube' + apply plugin: 'com.vanniktech.maven.publish' group = 'com.imsweb' - version = '11.3.2' + version = '11.4.0-SNAPSHOT' dependencies { - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' - testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.2' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' - testImplementation 'org.assertj:assertj-core:3.26.0' + testImplementation platform('org.junit:junit-bom:5.12.2') + testImplementation 'org.junit.jupiter:junit-jupiter-api' + testImplementation 'org.junit.jupiter:junit-jupiter-params' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.12.2' + + testImplementation 'org.assertj:assertj-core:3.27.3' testImplementation 'com.google.code.bean-matchers:bean-matchers:0.14' - testImplementation 'org.slf4j:slf4j-simple:2.0.13' + testImplementation 'org.slf4j:slf4j-simple:2.0.17' } // fail the build if there are compiler warnings @@ -62,9 +58,6 @@ subprojects { java { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - - withJavadocJar() - withSourcesJar() } repositories { @@ -134,79 +127,44 @@ subprojects { classpath = sourceSets.test.runtimeClasspath } - // don't try to sign a snapshot; its not needed - if (version.endsWith('-SNAPSHOT')) { - gradle.startParameter.excludedTaskNames += 'signMavenJavaPublication' - } + mavenPublishing { + configure(new JavaLibrary(new JavadocJar.Javadoc(), true)) - publishing { - publications { - mavenJava(MavenPublication) { - artifactId = project.name - from components.java - versionMapping { - usage('java-api') { - fromResolutionOf('runtimeClasspath') - } - usage('java-runtime') { - fromResolutionResult() - } - } - pom { - name = 'Staging Java Client' - description = 'A cancer staging client library' - url = 'https://github.com/imsweb/staging-client-java' - inceptionYear = '2015' - - licenses { - license { - name = 'A modified BSD License (BSD)' - url = 'https://github.com/imsweb/staging-client-java/blob/master/LICENSE' - distribution = 'repo' - } - } - - developers { - developer { - id = 'ctmay4' - name = 'Chuck May' - email = 'mayc@imsweb.com' - } - } - - scm { - url = 'https://github.com/imsweb/staging-client-java' - connection = 'scm:https://github.com/imsweb/staging-client-java.git' - developerConnection = 'scm:git@github.com:imsweb/staging-client-java.git' - } + publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true) + signAllPublications() + + pom { + name = 'Staging Java Client' + description = 'A cancer staging client library' + url = 'https://github.com/imsweb/staging-client-java' + inceptionYear = '2015' + + licenses { + license { + name = 'A modified BSD License (BSD)' + url = 'https://github.com/imsweb/staging-client-java/blob/master/LICENSE' + distribution = 'repo' } } - } - repositories { - maven { - def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2" - def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots" - url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl - - credentials { - username = project.findProperty('nexusUsername') ?: '' - password = project.findProperty('nexusPassword') ?: '' + + developers { + developer { + id = 'ctmay4' + name = 'Chuck May' + email = 'mayc@imsweb.com' } } + + scm { + url = 'https://github.com/imsweb/staging-client-java' + connection = 'scm:https://github.com/imsweb/staging-client-java.git' + developerConnection = 'scm:git@github.com:imsweb/staging-client-java.git' + } } } - signing { - def signingKey = project.findProperty('signingKey') ?: '' - def signingPassword = project.findProperty('signingPassword') ?: '' - - useInMemoryPgpKeys(signingKey, signingPassword) - - sign publishing.publications.mavenJava + wrapper { + gradleVersion = '8.14' + distributionType = Wrapper.DistributionType.ALL } -} - -wrapper { - gradleVersion = '8.8' - distributionType = Wrapper.DistributionType.ALL } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e6441136f..1b33c55ba 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6f7a6eb33..6514f919f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index b740cf133..23d15a936 100644 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -112,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -203,7 +205,7 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # and any embedded shellness will be escaped. # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # treated as '${Hostname}' itself on the command line. @@ -211,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 25da30dbd..db3a6ac20 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -68,11 +70,11 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/lib/build.gradle b/lib/build.gradle index 07d553e0b..729227467 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -3,22 +3,22 @@ plugins { } dependencies { - api "com.fasterxml.jackson.core:jackson-core:2.17.2" - api "com.fasterxml.jackson.core:jackson-annotations:2.17.2" - api "com.fasterxml.jackson.core:jackson-databind:2.17.2" + api "com.fasterxml.jackson.core:jackson-core:2.19.0" + api "com.fasterxml.jackson.core:jackson-annotations:2.19.0" + api "com.fasterxml.jackson.core:jackson-databind:2.19.0" implementation "org.cache2k:cache2k-api:2.6.1.Final" runtimeOnly "org.cache2k:cache2k-core:2.6.1.Final" - implementation 'org.apache.commons:commons-lang3:3.15.0' + implementation 'org.apache.commons:commons-lang3:3.17.0' implementation 'org.ahocorasick:ahocorasick:0.6.3' - implementation 'org.slf4j:slf4j-api:2.0.13' + implementation 'org.slf4j:slf4j-api:2.0.17' - testFixturesImplementation 'com.imsweb:seerapi-client-java:5.6' - testFixturesImplementation 'org.slf4j:slf4j-simple:2.0.13' + testFixturesImplementation 'com.imsweb:seerapi-client-java:5.8' + testFixturesImplementation 'org.slf4j:slf4j-simple:2.0.17' testFixturesImplementation 'org.zeroturnaround:zt-zip:1.17' - testFixturesImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' - testFixturesImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.3' + testFixturesImplementation 'org.junit.jupiter:junit-jupiter-api:5.12.2' + testFixturesImplementation 'org.junit.jupiter:junit-jupiter-params:5.12.2' }