Skip to content

Pin maven-source-plugin in MJAVADOC-639 IT for Maven 4 compatibility - #1332

Merged
hboutemy merged 2 commits into
apache:masterfrom
aschemaven:update-for-maven-4-0-0-rc-5
Jun 12, 2026
Merged

Pin maven-source-plugin in MJAVADOC-639 IT for Maven 4 compatibility#1332
hboutemy merged 2 commits into
apache:masterfrom
aschemaven:update-for-maven-4-0-0-rc-5

Conversation

@ascheman

@ascheman ascheman commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #1323 (cc @Bukama). PR #1323 enables maven4-enabled: true in the shared CI workflow and exposes 2 IT failures on every matrix cell. This PR addresses one of them — MJAVADOC-639_requires_ignored.

Root cause

The MJAVADOC-639_requires_ignored IT POM does not pin maven-source-plugin's version. Under Maven 4 the resolver picks the hard-coded default 4.0.0-beta-1, which throws NoSuchMethodError 'java.util.List org.apache.maven.api.services.ProjectManager.getCompileSourceRoots(...)' against the current org.apache.maven.api shape.

Locally Maven 4.0.0-rc-5 masks this via a "Latest version of plugin ... failed compatibility check / Looking for compatible RELEASE version" fallback that selects 3.4.0. CI (same rc-5 binary) and apache/maven master snapshot (4.1.0-SNAPSHOT) both skip the fallback and execute 4.0.0-beta-1 directly — so the bug surfaces on PR #1323's CI matrix and will hit users on rc-6 / GA.

Fix

Pin maven-source-plugin to 3.4.0 in the IT aggregator's <pluginManagement>. Mirrors the pattern landed for shade-plugin (MSHADE-105 etc., PR #816).

Out of scope

MJAVADOC-338_downloadSources also fails on PR #1323's CI (verify.groovy assertion on a Downloading from mrm-maven-plugin: ...-sources.jar log line that is missing on CI but present locally on both rc-5 and master snapshot). Not reproducible on macOS — needs a Linux-side reproduction of the MRM behaviour before a fix can be drafted. Tracked as a separate follow-up so this PR can land cleanly.

Verification

  • mvn clean verify -P run-its -Dinvoker.test='MJAVADOC-639*' with Maven 4.0.0-rc-5 on JDK 17.0.18 Temurin / macOS aarch64: 2/2 ITs pass (vs. 1/2 on 4.1.0-SNAPSHOT master snapshot prior to the fix).

cc @Bukama @hboutemy

The MJAVADOC-639_requires_ignored IT does not pin maven-source-plugin's version. Under Maven 4 the resolver picks the hard-coded default 4.0.0-beta-1 which throws NoSuchMethodError 'ProjectManager.getCompileSourceRoots(...)' against the current API.

Maven 4.0.0-rc-5 masks this locally via a "Latest version failed compatibility check -> fall back to RELEASE" path that selects 3.4.0, but the same code on rc-5 in CI (and on master snapshot 4.1.0-SNAPSHOT) executes 4.0.0-beta-1 directly and fails.

Pin maven-source-plugin to 3.4.0 in the IT aggregator's pluginManagement, mirroring the maven-shade-plugin pattern. Both submodules inherit the version.

The CI-only MJAVADOC-338_downloadSources failure is unrelated (MRM sources-jar log assertion) and tracked separately.

Follow-up to apache#1323.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread src/it/projects/MJAVADOC-639_requires_ignored/pom.xml Outdated
Per review on apache#1332: reference apache-parent's
version.maven-source-plugin property instead of the
hardcoded 3.4.0, so future bumps inherit cleanly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ascheman added a commit to aschemaven/maven-ear-plugin that referenced this pull request Jun 10, 2026
Add a maven-resources-plugin pin to the test-project aggregator's
pluginManagement, using the existing @-token interpolation pattern
(@mavenResourcesPluginVersion@, sourced from version.maven-resources-plugin
in the outer pom.xml via apache-parent).

Without the pin, Maven 4 rc-5 selects the baked-in default
maven-resources-plugin:4.0.0-beta-1 for the resources goal on
sar-sample-two, which raises a NoSuchMethodError against the current
org.apache.maven.api shape:

    NoSuchMethodError 'java.util.List
      org.apache.maven.api.services.ProjectManager.getResources(
        org.apache.maven.api.Project, org.apache.maven.api.ProjectScope)'

The same masking pattern (locally-cached 3.x version + Maven 4
"compatibility-failed fallback" → silent pass) is what we already
fixed for maven-source-plugin in MJAVADOC-639 (apache/maven-javadoc-plugin#1332).

Empirical evidence: aschemaven/maven-ear-plugin#mvn4-pr499-fail-at-end
CI run 27273896660 reproduced the failure on all 6 rc-5 lanes
(linux/macos/windows x jdk-21/25-zulu). The next CI run after this
commit should show only the skinny-wars-timestamp checksum failure
remaining (which is tracked separately as Failure A in the workspace
plan).

@hboutemy hboutemy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, failing job is varying from run to run, and not related to the PR
I don't know why there is such a large matrix, but this should not force us to wait for this fix

@hboutemy
hboutemy merged commit 586fb6b into apache:master Jun 12, 2026
96 of 102 checks passed
@github-actions

Copy link
Copy Markdown

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

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.

3 participants