Skip to content

Build against Maven 4.0.0-rc-6, and honour <skip> on testResources - #500

Merged
slachiewicz merged 3 commits into
apache:masterfrom
slachiewicz:maven-4.0.0-rc-6
Aug 4, 2026
Merged

Build against Maven 4.0.0-rc-6, and honour <skip> on testResources#500
slachiewicz merged 3 commits into
apache:masterfrom
slachiewicz:maven-4.0.0-rc-6

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Moves mavenVersion to the current RC and pins the same version explicitly in the Verify workflow.

That surfaced a pre-existing bug. MRESOURCES-131 sets <skip>true</skip> in pluginManagement and asserts the test resource is not copied; it has been failing since 4.0.0-rc-5 — main resources skips, testResources does not:

--- resources:resources (default-resources) ---
[INFO] Skipping the execution.
--- resources:testResources (default-testResources) ---
[INFO] Copying 1 resource from src/test/resources to target/test-classes

ResourcesMojo and TestResourcesMojo both declare a private field named skip. They collapse into a single descriptor parameter for the testResources goal, and the configurator writes the superclass field — so TestResourcesMojo's own field stays false whatever the build configured, and its guard never fires. Reading both restores the documented behaviour while keeping maven.test.skip and maven.resources.skip working as before.

Renaming the field so the two stop shadowing is not an option: the descriptor generator then sees two parameters called skip for one goal and fails with skip has been declared multiple times in mojo with goal: testResources.

mvn verify -Prun-its passes, 24 unit tests, 0 failures. Part of apache/maven#12676. Verified green on a fork before opening.

slachiewicz and others added 2 commits August 4, 2026 02:17
Move the Maven 4 version property to the current RC and pin the same
version explicitly in the Verify workflow, so CI does not depend on the
maven4-version default in maven-gh-actions-shared.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
MRESOURCES-131 sets <skip>true</skip> in pluginManagement and asserts the
test resource is not copied. It has been failing since 4.0.0-rc-5: the main
resources goal skips, testResources does not.

Both ResourcesMojo and TestResourcesMojo declare a private field named
"skip". They collapse into a single descriptor parameter for the
testResources goal, and the configurator writes the superclass field — so
this class's own field stays false no matter what the build configured, and
the guard never fires. Reading both restores the documented behaviour while
keeping maven.test.skip and maven.resources.skip working as before.

Renaming the field so the two stop shadowing does not work: the descriptor
generator then sees two parameters called "skip" for one goal and fails
with "skip has been declared multiple times in mojo with goal:
testResources".

mvn verify -Prun-its: all ITs pass, 24 unit tests, 0 failures.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
apache/maven#12626 fixes the cause in the core configurator, so record what
lets this be removed rather than leaving it to be rediscovered.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@slachiewicz
slachiewicz merged commit bf1acfe into apache:master Aug 4, 2026
8 checks passed
@slachiewicz
slachiewicz deleted the maven-4.0.0-rc-6 branch August 4, 2026 15:28
@github-actions github-actions Bot added this to the 4.0.0-beta-2 milestone Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants