Test against JDK 17, 21 and 25 in CI - #171
Open
davidpavlovschi wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the remaining unchecked Patch item in #74: "Test on Java 8 and latest Java version to ensure compatibility as versions are released".
What changes
.github/workflows/maven_test.ymlcurrently pins a single toolchain (Set up JDK 17,java-version: 17), so nothing catches a regression that only shows up on a newer JDK until a user reports it. This adds afail-fast: falsematrix overjava: [ 17, 21, 25 ], renames the job toTest (JDK ${{ matrix.java }})so the three legs are distinguishable in the checks list, and runs the existing./mvnw clean verify -P integration-testunchanged on each.The Maven cache key gains a
jdk${{ matrix.java }}segment (${{ runner.os }}-m2-jdk17-<hash>etc.). Without it the three parallel legs onmasterall try to save${{ runner.os }}-m2-<hash>, so two of the threeactions/cachesaves would collide on the same key ("Unable to reserve cache … already exists") and the legs would keep overwriting one shared entry. Cache behaviour on the GitHub runners is the one part of this change that can only be exercised once it runs onmaster.Only the workflow file changes; no source, no
pom.xml, no dependency versions.Why Java 8 is not in the matrix
The issue asks for a Java 8 leg, but the toolchain cannot be JDK 8 in this repo:
pom.xmldeclarescompile-java-9(<release>9</release>) andcompile-java-17(<release>17</release>) executions for the multi-release jar, andmaven-javadoc-pluginis configured with<source>17</source>.tools.jackson.core:jackson-databind3.2.1 is aprovided-scope dependency (so it is on the compile and test classpath) and Jackson 3 has a Java 17 baseline.So 17 is the floor for building. The Java 8 target is already enforced independently of the toolchain by
<release>${java.version}</release>(java.version= 8) on thedefault-compileexecution —--release 8is what makes javac reject post-8 APIs, and it does that identically on a JDK 17, 21 or 25 toolchain. Adding a JDK 8 leg would not test anything the existingrelease 8setting does not already cover, and it cannot be done without dropping Jackson 3 support.One thing the new legs surface that is worth knowing about: on JDK 21 and 25, javac emits
source value 8 is obsolete and will be removed in a future release/target value 8 is obsolete …(2 occurrences each). JDK 17 does not. That is a warning today, but it is the signal for when the Java 8 target will actually need to be revisited, and having 21/25 in CI is what makes it visible.Verified
All three matrix legs were run locally with the exact workflow command, each on the matching Temurin JDK (macOS 27.0 / aarch64, not the ubuntu-latest runner):
./mvnw clean verify -P integration-teston Temurin 17.0.20+8 — exit 0,Tests run: 317, Failures: 0, Errors: 0, Skipped: 4, invokerPassed: 3, Failed: 0, Errors: 0, Skipped: 0, BUILD SUCCESS.Tests run: 317, Failures: 0, Errors: 0, Skipped: 4, invokerPassed: 3, Failed: 0, Errors: 0, Skipped: 0, BUILD SUCCESS.Tests run: 317, Failures: 0, Errors: 0, Skipped: 4, invokerPassed: 3, Failed: 0, Errors: 0, Skipped: 0, BUILD SUCCESS.The workflow file also parses as YAML with the expected
strategy: {fail-fast: false, matrix: {java: [17, 21, 25]}}.Not verified locally: the cache hit/miss behaviour on the GitHub runners — that only exercises once this runs on
master.If you would rather keep CI to two legs (17 + latest) to hold runner minutes down, dropping
21from the list is the only edit needed.Summary by cubic
Expand CI to test on JDK 17, 21, and 25 to catch Java-version regressions and meet #74. Adds per-JDK cache keys and clearer job names; Maven command stays the same.
java: [17, 21, 25]withfail-fast: false; job renamed to "Test (JDK ${{ matrix.java }})".jdk${{ matrix.java }}to avoid collisions across parallel runs.jackson-databind3.x); Java 8 target stays enforced via--release 8, so no JDK 8 CI leg.Written for commit 7c176d6. Summary will update on new commits.