Fail fast when the e2e docker targets run on a JDK older than 17 - #14072
Merged
Conversation
test/Makefile listed docker.e2e-spring-ai-service unconditionally, but the e2e reactor only builds that module under its jdk-17 profile. On JDK 11 the docker target therefore copied a jar that was never produced, and on a checkout that had previously built under JDK 17 it packaged a stale one instead -- `clean` never reaches a module the profile excluded. Neither failure points at the cause. The missing jar is bind-mounted by path, so Docker creates a directory in its place and the container dies with "Invalid or corrupt jarfile", naming neither the module nor the JDK. Refuse at parse time instead, scoped to the goals that need the module so the other four images stay buildable by name on any JDK.
wankai123
approved these changes
Sep 11, 2026
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.
Fix
make -C test dockersilently producing a missing or stalee2e-spring-ai-servicejarFollow-up to #14071, addressing a review finding on
test/Makefile.DOCKER_TARGETSlistsdocker.e2e-spring-ai-serviceunconditionally, but the e2e reactor only builds that module under itsjdk-17profile (<jdk>[17,)</jdk>, needed because Spring AI requires Java 17 / Spring Boot 4). The Makefile and the pom disagreed about when the module exists, which gives two failures:DOCKER_RULEcopies a jar that was never produced:build.e2e-servicerunsclean package, butcleanonly reaches modules in the reactor. On JDK 11 the module is excluded, so a jar left from an earlier JDK 17 build survives and is packaged into an image tagged with the current commit.Neither failure names the cause, and the downstream symptom is worse than either. The jar is bind-mounted by path, so when it is absent Docker creates a directory where the file should be and the container dies with:
That mentions neither the module nor the JDK, and it leaves a bogus directory in the tree that a later
mvn packagethen fails to write over.This refuses at parse time instead, before any work happens:
The check is
-ge 17, mirroring the profile's[17,)rather than pinning exactly 17, so JDK 21 and 25 still build the image — thee2e-test-java-versionsmatrix runs[11, 17, 25], and an== 17check would wrongly refuse on the 25 leg.It is scoped to the goals that actually need the module, so the other four images stay buildable by name on any JDK. Verified across both JDKs:
dockerdocker.e2e-servicedocker.push-e2e-servicedocker.e2e-spring-ai-servicepush.docker.e2e-spring-ai-servicedocker.e2e-service-providerdocker.e2e-mock-llm-serverinit/ no goalCI behaviour is unchanged:
publish-docker-e2e-service.yamlpins JDK 17 and itsmake -C test build.e2e-service docker.push-e2e-serviceinvocation still builds and pushes all five images. Confirmed by a realmake -C test docker.e2e-spring-ai-serviceon JDK 17 after the change.Version parsing was checked against every installed JDK plus the legacy
1.8.xform (1.8.0_322→8, not1); ifjavais absent entirely the comparison yields no match and the guard fires, which is the safe direction.CHANGESlog.The CHANGES entry is folded into #14071's existing 11.1.0 bullet rather than added as a separate line, since both are part of the same unreleased change and a build-tooling guard is not a distinct user-facing item.