AGS-13/AGS-14: Java 21 baseline, enforced, with a committed Maven wrapper - #15
Open
Ugbot wants to merge 1 commit into
Open
AGS-13/AGS-14: Java 21 baseline, enforced, with a committed Maven wrapper#15Ugbot wants to merge 1 commit into
Ugbot wants to merge 1 commit into
Conversation
…pper Java 21 was decided as the baseline but all 13 poms still declared 17, and nothing enforced or provisioned the toolchain. Baseline (AGS-13): - All 13 poms now declare 21, via `release` rather than source/target. With source/target javac links against the *host* JDK's API, so code can reference post-baseline methods, compile clean, and then NoSuchMethodError on a real baseline JVM. Verified the change took effect: emitted class files are major version 65. - ports/quarkus and ports/kafka-streams already used <release> and were left alone. No literal 17 remains in any pom. Enforcement (AGS-14): - Committed mvnw / mvnw.cmd / .mvn/wrapper, pinned to Maven 3.9.16. The build no longer needs a preinstalled mvn — the exact failure mode that cost a reinstall when the home directory was wiped on 2026-07-26, since the only mvn on that machine lived inside the deleted ~/.m2. - maven-enforcer-plugin: requireJavaVersion [21,) and requireMavenVersion [3.9,), each with an actionable message. Verified the rule actually fires by temporarily demanding JDK 99 and confirming the build failed with our text, not a generic error. - Lombok 1.18.38 -> 1.18.46 (1.18.40 first supported JDK 25), so a later baseline bump isn't blocked by annotation processing. - Runtime --add-opens, which surefire had but no launcher did: .mvn/jvm.config covers every `mvn exec:java` path (exec:java runs in the Maven JVM), and a new examples-bin/jvm-opts.sh holds the single flag list the two bare `java -jar` launchers source. Also chmod +x run-banking-local.sh, which was 100644 while all 14 siblings were 100755. - CI now invokes ./mvnw instead of the runner's mvn, so every run exercises the wrapper. A maven-toolchains-plugin was considered and skipped: with the enforcer plus a pinned wrapper it adds a toolchains.xml prerequisite for no extra guarantee. Verified locally on JDK 21.0.12 via ./mvnw: jagentic-core 95, main module 770, ports 6, agentic-pekko 14, tool-services 26, a2a-gateway 9 — all green. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Java 21 was decided as the baseline, but all 13 poms still declared 17 and nothing enforced or provisioned the toolchain. These two tickets are coupled — enforcing a baseline you have not actually set is meaningless — so they land together.
Baseline (AGS-13)
All 13 poms now declare 21, via
<release>rather thansource/target.That mechanism change matters independently: with
source/target, javac links against the host JDK's API, so code can reference post-baseline methods, compile clean, and thenNoSuchMethodErroron a real baseline JVM.releasepins the API too.ports/quarkusandports/kafka-streamsalready did this correctly and were left alone. No literal17remains in any pom.Verified it actually took effect, not just declared — emitted class files are
major version: 65.Enforcement (AGS-14)
mvnw/mvnw.cmd/.mvn/wrapper/, pinned to Maven 3.9.16. The build no longer needs a preinstalled mvn. This is not hypothetical: when the home directory was wiped on 2026-07-26, the only Maven on the machine lived inside the deleted~/.m2, so the loss took the build tool with the cache. A committed wrapper makes that a non-event.maven-enforcer-plugin—requireJavaVersion [21,)andrequireMavenVersion [3.9,), each with an actionable message so a contributor on JDK 17 is told the baseline rather than handed an obscure compiler error.--add-opens, which surefire had but no launcher did..mvn/jvm.configcovers everymvn exec:javapath —exec:javaruns in the Maven JVM — and a newexamples-bin/jvm-opts.shholds the single flag list that the two barejava -jarlaunchers source. Alsochmod +x run-banking-local.sh, which was 100644 while all 14 siblings were 100755../mvnwinstead of the runner's mvn, so every run exercises the wrapper.Verification
Both rules were checked for firing, not just presence — I temporarily demanded JDK 99 and confirmed the build failed with our own message rather than a generic error, then reverted:
Full local build on JDK 21.0.12 through
./mvnw:All green, plus
enforcer:3.5.0reporting both rules passed.Considered and skipped
maven-toolchains-plugin— with the enforcer plus a pinned wrapper it adds atoolchains.xmlprerequisite for no additional guarantee on this project.Backlog entries for AGS-13 and AGS-14 are marked done in
docs/audit-backlog.md.🤖 Generated with Claude Code