Fix #13191: add -Dmaven.maven3Personality hint to FATAL message for wrong parent relativePath - #13202
Merged
gnodet merged 1 commit intoSep 20, 2026
Conversation
gnodet
force-pushed
the
backport/13191-shade-relativepath-to-4.0.x
branch
from
September 19, 2026 20:56
12d8e00 to
e8e3823
Compare
…rent relativePath (apacheGH-13191)
gnodet
force-pushed
the
backport/13191-shade-relativepath-to-4.0.x
branch
from
September 19, 2026 20:58
e8e3823 to
92a5168
Compare
gnodet-bot
approved these changes
Sep 19, 2026
gnodet-bot
left a comment
There was a problem hiding this comment.
Clean backport of #13196 to maven-4.0.x. Message change is accurate and scoped correctly to the !maven3Mode && !defaultPath branch (explicit <relativePath> pointing at wrong GA). FATAL severity preserved — no behaviour change, only improved diagnostics.
Test testWrongRelativePathInGeneratedPomIsFatalWithMaven3Hint correctly reproduces the shade-plugin scenario: reducedPom has <relativePath>pom.xml</relativePath> resolving to the project's own GA, triggering the FATAL. The three message assertions ("relativePath", "pom.xml", "maven.maven3Personality") all match the actual generated message string. Diff is identical to the master PR.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
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.
Backport of #13196 to
maven-4.0.x.Summary
Fixes #13191 — improves the FATAL error message when an explicit
<relativePath>resolves to a different G:A than the declared parent.When a POM declares an explicit
<relativePath>that resolves to a different G:A than the declared parent, Maven 4 raises a FATAL error. This is correct behaviour — it is a configuration error. However, the error message was unhelpful.A common cause is maven-shade-plugin generating
dependency-reduced-pom.xmlwith a<relativePath>that is invalid in the generated context (see apache/maven-shade-plugin#813). Users hit a FATAL with no guidance.Change
Message-only change in
mismatchRelativePathAndGA. The FATAL message now mentions:<relativePath>(e.g. maven-shade-plugin) should be upgraded-Dmaven.maven3Personalityas an explicit temporary workaroundThe right fix
apache/maven-shade-plugin#843: emit
<relativePath/>in generated POMs.