Skip to content

chore: Update Gradle wrapper to 9.5.1 - #38

Closed
kinyoklion wants to merge 1 commit into
mainfrom
devin/1793052497-gradle-9
Closed

kinyoklion wants to merge 1 commit into
mainfrom
devin/1793052497-gradle-9

Conversation

@kinyoklion

Copy link
Copy Markdown
Member

Summary

Replaces dependabot's #35, which only bumped the wrapper files. It failed for two reasons: Gradle 9 needs Java 17+ to run, and the build used APIs that Gradle 9 removed.

Gradle 9 needs Java 17 to run, but the library still targets Java 8

  • compileJava now uses options.release = 8, so the compiler checks against the Java 8 API and emits class version 52.
  • CI (.github/actions/ci) installs both the matrix JDK and JDK 17. Gradle runs on 17, and the tests run on the matrix JDK through a toolchain:
    ./gradlew test -PtestJavaVersion=8 -Porg.gradle.java.installations.fromEnv=JAVA_HOME_8_X64
    
    Without -PtestJavaVersion, the tests run on the JVM that runs Gradle.
  • The .ldrelease image changes from gradle:7.6-jdk8 to gradle:9.5.1-jdk17.

Build script changes for Gradle 9

  • archivesBaseName / sourceCompatibility set as project conventions → base { archivesName } / java { }.
  • The hand-rolled sourcesJar/javadocJar tasks used classifier, which was removed. They are replaced by java { withSourcesJar(); withJavadocJar() }.
  • de.marcphilipp.nexus-publish 0.4.0 and io.codearte.nexus-staging 0.30.0 fail on Gradle 9 (org/gradle/util/ConfigureUtil was removed). Both are replaced by io.github.gradle-nexus.publish-plugin 2.0.0, set up with the same Central Portal OSSRH-staging URLs that java-core uses. The ossrhUsername/ossrhPassword credentials stay the same.
  • maven { url "..." } → url = "..." (deprecated in 9.x, removed in 10).

Checked locally

  • Gradle 9.5.1 on JDK 17: jar javadoc checkstyleMain publishToMavenLocal passes with --warning-mode all and no deprecation warnings.
  • Tests pass against DynamoDB Local when run on JDK 8 and JDK 11 through the toolchain path. The test executor really was /usr/lib/jvm/java-{8,11}-openjdk-amd64/bin/java.
  • Compared with the 7.6/JDK 8 build on main:
    • The POM is identical.
    • The main jar has the same entries, and the classes are still version 52.
    • The .module file gains javadocElements/sourcesElements variants, which is what withJavadocJar/withSourcesJar add.
  • In the gradle:9.5.1-jdk17 image, the build and publishToMavenLocal pass, and the publishToSonatype and closeAndReleaseSonatypeStagingRepository tasks are present.

Reviewer notes

  • The new plugin's task names differ from the old staging plugin's (closeAndReleaseRepository → closeAndReleaseSonatypeStagingRepository). I can't see which tasks the Releaser gradle template runs, so please confirm the release path. Releases from this repo were already pointed at the retired oss.sonatype.org OSSRH host.
  • Javadoc is now generated by JDK 17 instead of JDK 8, so the HTML layout of the javadoc jar and GitHub Pages changes.

Link to Devin session: https://app.devin.ai/sessions/1a79310b63c847508c621a56ea406e4c
Open in Devin Desktop: https://app.devin.ai/desktop/session/1a79310b63c847508c621a56ea406e4c?variant=devin
Requested by: @kinyoklion

Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@kinyoklion

Copy link
Copy Markdown
Member Author

Closing in favor of doing this while migrating to java-core.

@kinyoklion kinyoklion closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant