From 891f7bc5b012f735a0e0c1d77fddebb9275b9509 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Tue, 4 Aug 2026 02:17:43 +0200 Subject: [PATCH 1/3] Build against Maven 4.0.0-rc-6 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) --- .github/workflows/maven-verify.yml | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven-verify.yml b/.github/workflows/maven-verify.yml index e86e064..41b374b 100644 --- a/.github/workflows/maven-verify.yml +++ b/.github/workflows/maven-verify.yml @@ -26,6 +26,6 @@ jobs: name: Verify uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v5 with: - ff-maven: "4.0.0-rc-4" # Maven version for fail-fast-build - maven-matrix: '[ "4.0.0-rc-4" ]' + ff-maven: "4.0.0-rc-6" # Maven version for fail-fast-build + maven-matrix: '[ "4.0.0-rc-6" ]' jdk-matrix: '[ "17", "21" ]' diff --git a/pom.xml b/pom.xml index 6775252..32152c2 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ under the License. - 4.0.0-rc-4 + 4.0.0-rc-6 17 7.0.0 From 1cb0e1c210edad5b90d1941e46000c1a7d6e97cb Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Tue, 4 Aug 2026 13:19:51 +0200 Subject: [PATCH 2/3] Honour on the testResources goal again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MRESOURCES-131 sets true 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) --- .../apache/maven/plugins/resources/TestResourcesMojo.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/maven/plugins/resources/TestResourcesMojo.java b/src/main/java/org/apache/maven/plugins/resources/TestResourcesMojo.java index 1e1218d..18f78b7 100644 --- a/src/main/java/org/apache/maven/plugins/resources/TestResourcesMojo.java +++ b/src/main/java/org/apache/maven/plugins/resources/TestResourcesMojo.java @@ -62,7 +62,12 @@ public class TestResourcesMojo extends ResourcesMojo { * {@inheritDoc} */ public void execute() throws MojoException { - if (skip) { + // isSkip() reads ResourcesMojo's own field. Both classes declare a private + // "skip", so the two collapse into a single descriptor parameter and the + // configurator writes the superclass one, leaving this class's field false + // however the build configured . Reading both is what makes + // true reach this goal at all. + if (skip || isSkip()) { getLog().info("Not copying test resources"); return; } From 81459b765b284c2d847efae64f17b4c742264376 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Tue, 4 Aug 2026 14:37:39 +0200 Subject: [PATCH 3/3] Note that the skip workaround is temporary 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) --- .../apache/maven/plugins/resources/TestResourcesMojo.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/apache/maven/plugins/resources/TestResourcesMojo.java b/src/main/java/org/apache/maven/plugins/resources/TestResourcesMojo.java index 18f78b7..e9c6fd9 100644 --- a/src/main/java/org/apache/maven/plugins/resources/TestResourcesMojo.java +++ b/src/main/java/org/apache/maven/plugins/resources/TestResourcesMojo.java @@ -67,6 +67,11 @@ public void execute() throws MojoException { // configurator writes the superclass one, leaving this class's field false // however the build configured . Reading both is what makes // true reach this goal at all. + // + // TODO temporary: drop the isSkip() half once apache/maven#12626 is in a + // release. That fixes the cause in the core configurator, where + // buildFieldCache() lets a parent field shadow the child's, and then this + // class's own field will be configured directly. if (skip || isSkip()) { getLog().info("Not copying test resources"); return;