Skip to content

[4.0.x] Make run-its profile extract the built distribution - #12852

Merged
gnodet merged 1 commit into
maven-4.0.xfrom
backport/it-self-contained-to-maven-4.0.x
Aug 26, 2026
Merged

[4.0.x] Make run-its profile extract the built distribution#12852
gnodet merged 1 commit into
maven-4.0.xfrom
backport/it-self-contained-to-maven-4.0.x

Conversation

@gnodet

@gnodet gnodet commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport of the self-contained IT distribution extraction from master (#2476 and #12828), adapted for the maven-4.0.x branch structure.

Problem: The run-its profile on 4.0.x uses <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-its silently tests the wrong Maven.

Fix (pom.xml):

  • Override mavenHome to ${project.build.directory}/apache-maven in the run-its profile
  • Download the built distribution via maven-dependency-plugin:copy
  • Extract it via maven-antrun-plugin
  • This follows the same pattern already used by the maven-from-repo and maven-distro profiles

Fix (workflow):

  • Remove the now-redundant download/extract/PATH steps from the integration-tests CI job
  • Use the Maven wrapper instead, since the pom.xml now handles distribution extraction self-contained

Test plan

  • CI passes: the integration-tests matrix (3 OS × 3 JDK) should all pass
  • full-build job is unchanged and still passes (it still needs the artifact for self-hosting verification)
  • Locally, mvn install -Prun-its tests the built Maven distribution, not the building Maven

🤖 Generated with Claude Code

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>
@gnodet gnodet added the bug Something isn't working label Aug 26, 2026
@gnodet gnodet added this to the 4.0.0-rc-7 milestone Aug 26, 2026
@gnodet
gnodet merged commit 0c4841a into maven-4.0.x Aug 26, 2026
2 checks passed
@gnodet
gnodet deleted the backport/it-self-contained-to-maven-4.0.x branch August 26, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-4.0.x bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant