Skip to content

[4.0.x] Fix Source.targetPath incorrectly aligned to basedir#12235

Merged
gnodet merged 1 commit into
apache:maven-4.0.xfrom
gnodet:cherry-pick-12206-to-4.0.x
Jun 4, 2026
Merged

[4.0.x] Fix Source.targetPath incorrectly aligned to basedir#12235
gnodet merged 1 commit into
apache:maven-4.0.xfrom
gnodet:cherry-pick-12206-to-4.0.x

Conversation

@gnodet

@gnodet gnodet commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Cherry-pick of #12206

The DefaultModelPathTranslator was aligning Source.targetPath to the
project basedir, converting relative paths like "META-INF/tags/rdc"
into absolute paths. This caused maven-resources-plugin to copy
resources to wrong locations (e.g., /META-INF/tags/rdc instead of
target/classes/META-INF/tags/rdc).

The targetPath is relative to the output directory (target/classes or
target/test-classes), not the project basedir, so it must not be
resolved against basedir during model path translation.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet merged commit 79aad04 into apache:maven-4.0.x Jun 4, 2026
1 check passed
@github-actions github-actions Bot added this to the 4.0.0-rc-6 milestone Jun 4, 2026
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

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

@gnodet gnodet added backport mvn40 bug Something isn't working labels Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug Something isn't working mvn40

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant