[4.0.x] Make run-its profile extract the built distribution - #12852
Merged
Conversation
Backport of the self-contained IT distribution extraction from master (#2476 and #12828). Previously, the run-its profile relied on ${maven.home} which points to the Maven running the build, not the Maven being tested. This meant ITs silently tested the wrong Maven when built with a different version. The run-its profile now: - Overrides mavenHome to ${project.build.directory}/apache-maven - Downloads the built distribution via maven-dependency-plugin - Extracts it via maven-antrun-plugin This follows the same pattern already used by the maven-from-repo and maven-distro profiles. The CI workflow is simplified accordingly: the integration-tests job no longer needs to download, extract, and PATH-inject the distribution from the initial-build artifact. The Maven wrapper is used instead. Co-Authored-By: Claude Opus 4.6 <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.
Summary
Backport of the self-contained IT distribution extraction from master (#2476 and #12828), adapted for the
maven-4.0.xbranch structure.Problem: The
run-itsprofile on4.0.xuses<mavenHome>${maven.home}</mavenHome>, which resolves to whichever Maven runs the build — not the Maven being tested. On CI this was masked because the workflow downloads/extracts the built distribution and puts it on$PATH, so${maven.home}happens to point at the right thing. Locally,mvn test -Prun-itssilently tests the wrong Maven.Fix (pom.xml):
mavenHometo${project.build.directory}/apache-mavenin therun-itsprofilemaven-dependency-plugin:copymaven-antrun-pluginmaven-from-repoandmaven-distroprofilesFix (workflow):
integration-testsCI jobTest plan
integration-testsmatrix (3 OS × 3 JDK) should all passfull-buildjob is unchanged and still passes (it still needs the artifact for self-hosting verification)mvn install -Prun-itstests the built Maven distribution, not the building Maven🤖 Generated with Claude Code