Skip to content

Fix integration tests for Maven 4.0.0-rc-5 builds#816

Merged
hboutemy merged 1 commit into
apache:masterfrom
aschemaven:update-for-maven-4-0-0-rc-5
Jun 7, 2026
Merged

Fix integration tests for Maven 4.0.0-rc-5 builds#816
hboutemy merged 1 commit into
apache:masterfrom
aschemaven:update-for-maven-4-0-0-rc-5

Conversation

@ascheman

@ascheman ascheman commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Pin plugin versions in six failing integration tests so the suite builds clean under Maven 4.0.0-rc-5.

Companion to #810 (which flips the shared workflow's maven4-enabled: true flag); per @hboutemy's review feedback, this PR no longer touches the workflow — #810 will rebase on top of this once these IT fixes land.

Root cause

Under Maven 4.0.0-rc-5, when an IT POM does not pin a plugin version, Maven 4 picks the 4.0.0-beta-1 of maven-jar-plugin, maven-resources-plugin, maven-source-plugin as the default. Those betas were built against an earlier Maven 4 rc API which has since changed; they throw NoSuchMethodError at runtime on:

  • Project.getPomArtifact() (for maven-jar-plugin:4.0.0-beta-1)
  • ProjectManager.getResources(...) (for maven-resources-plugin:4.0.0-beta-1)
  • PluginParameterExpressionEvaluator.<init>(...) (for maven-enforcer-plugin:1.0, inherited from oss-parent:7)

Changes

  • src/it/projects/MSHADE-105/pom.xml — add <pluginManagement> pinning resources + jar plugins
  • src/it/projects/MSHADE-284_shadeTestJar/pom.xml — pin maven-jar-plugin
  • src/it/projects/MSHADE-285_createTestSourcesJar/pom.xml — pin maven-source-plugin and maven-jar-plugin via the parent-pom filter properties (@version.maven-source-plugin@, @version.maven-jar-plugin@)
  • src/it/projects/MSHADE-340_shadedTestJarArtifactAttached/pom.xml — same pattern
  • src/it/projects/MSHADE-467_parallel-dependency-reduced-pom/pom.xml — add maven-jar-plugin to <pluginManagement>
  • src/it/projects/mshade-123/pom.xml — drop <parent>org.sonatype.oss:oss-parent:7</parent> (was pulling in maven-enforcer-plugin:1.0)

Test plan

Verified locally with sdkman-installed Apache Maven 4.0.0-rc-5 (fb3ecaef…) on JDK 17.0.18 Temurin / macOS aarch64, isolated -Dmaven.repo.local:

Build Summary:
  Passed: 83, Failed: 0, Errors: 0, Skipped: 1

Versus the pre-fix baseline of Passed: 76, Failed: 7, Errors: 0, Skipped: 1.

After merge

Comment thread .github/workflows/maven-verify.yml Outdated
Comment thread src/it/projects/MSHADE-285_createTestSourcesJar/pom.xml Outdated
Six integration tests failed when building under Maven 4.0.0-rc-5 because their POMs do not pin the versions of maven-jar-plugin, maven-resources-plugin, maven-source-plugin, or (via oss-parent:7) maven-enforcer-plugin. Maven 4 then picked the 4.0.0-beta-1 of those plugins as the default, and the beta versions were built against an earlier Maven 4 rc API that has since changed; they throw NoSuchMethodError on Project.getPomArtifact, ProjectManager.getResources, or PluginParameterExpressionEvaluator.<init> at runtime.

Pin the affected plugin versions in:
- src/it/projects/MSHADE-105/pom.xml (pluginManagement)
- src/it/projects/MSHADE-284_shadeTestJar/pom.xml
- src/it/projects/MSHADE-285_createTestSourcesJar/pom.xml
- src/it/projects/MSHADE-340_shadedTestJarArtifactAttached/pom.xml
- src/it/projects/MSHADE-467_parallel-dependency-reduced-pom/pom.xml (pluginManagement)

For maven-source-plugin in MSHADE-285 and MSHADE-340, use the @version.maven-source-plugin@ filter property provided by the maven-plugins parent (per @hboutemy review feedback), matching the existing pattern for maven-jar-plugin and maven-resources-plugin.

In src/it/projects/mshade-123/pom.xml, drop the inherited org.sonatype.oss:oss-parent:7 parent which transitively pinned maven-enforcer-plugin to 1.0.

Verified: mvn -P run-its clean verify with sdkman-installed Maven 4.0.0-rc-5 (fb3ecaef...) on JDK 17 Temurin / macOS aarch64 — Passed: 83, Failed: 0, Errors: 0, Skipped: 1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ascheman ascheman force-pushed the update-for-maven-4-0-0-rc-5 branch from 14169e3 to 5c7e71d Compare June 7, 2026 11:14
@hboutemy hboutemy merged commit f040f99 into apache:master Jun 7, 2026
11 checks passed
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

@hboutemy Please assign appropriate label to PR according to the type of change.

@github-actions github-actions Bot added this to the 3.6.3 milestone Jun 7, 2026
@hboutemy hboutemy added the build Pull requests that change the build process label Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Pull requests that change the build process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants