Fix integration tests for Maven 4.0.0-rc-5 builds#816
Merged
Conversation
hboutemy
requested changes
Jun 7, 2026
hboutemy
reviewed
Jun 7, 2026
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>
14169e3 to
5c7e71d
Compare
hboutemy
approved these changes
Jun 7, 2026
|
@hboutemy Please assign appropriate label to PR according to the type of change. |
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
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: trueflag); 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-1ofmaven-jar-plugin,maven-resources-plugin,maven-source-pluginas the default. Those betas were built against an earlier Maven 4 rc API which has since changed; they throwNoSuchMethodErrorat runtime on:Project.getPomArtifact()(formaven-jar-plugin:4.0.0-beta-1)ProjectManager.getResources(...)(formaven-resources-plugin:4.0.0-beta-1)PluginParameterExpressionEvaluator.<init>(...)(formaven-enforcer-plugin:1.0, inherited fromoss-parent:7)Changes
src/it/projects/MSHADE-105/pom.xml— add<pluginManagement>pinning resources + jar pluginssrc/it/projects/MSHADE-284_shadeTestJar/pom.xml— pinmaven-jar-pluginsrc/it/projects/MSHADE-285_createTestSourcesJar/pom.xml— pinmaven-source-pluginandmaven-jar-pluginvia the parent-pom filter properties (@version.maven-source-plugin@,@version.maven-jar-plugin@)src/it/projects/MSHADE-340_shadedTestJarArtifactAttached/pom.xml— same patternsrc/it/projects/MSHADE-467_parallel-dependency-reduced-pom/pom.xml— addmaven-jar-pluginto<pluginManagement>src/it/projects/mshade-123/pom.xml— drop<parent>org.sonatype.oss:oss-parent:7</parent>(was pulling inmaven-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:Versus the pre-fix baseline of
Passed: 76, Failed: 7, Errors: 0, Skipped: 1.After merge
maven-shade-pluginrow: markworks with 4.0.0-rc-5: ✓, set status to Done, shorten the comment to "Fixed in Fix integration tests for Maven 4.0.0-rc-5 builds #816".maven4-enabled: true(per @hboutemy review).