You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/06/02 11:08:24 UTC
[PR] Fix Source.targetPath incorrectly aligned to basedir [maven]
gnodet opened a new pull request, #12206:
URL: https://github.com/apache/maven/pull/12206
## Summary
- `DefaultModelPathTranslator.alignToBaseDirectory(Source)` was incorrectly resolving `Source.targetPath` against the project basedir, converting relative paths like `META-INF/tags/rdc` into absolute paths like `/path/to/project/META-INF/tags/rdc`
- This caused `maven-resources-plugin` to copy resources to wrong locations when using POM 4.1.0 `<source>` elements with `<targetPath>`
- The `targetPath` is relative to the output directory (`target/classes`), not the project basedir, so it must not be aligned during model path translation
## Test plan
- [x] Unit tests: `DefaultModelPathTranslatorTest` — verifies Source directory is aligned but targetPath is not, dot-prefixed targetPath stays relative, Resource directory is aligned but targetPath is not
- [x] Integration tests: `ProjectBuilderTest#testSourceTargetPathRemainsRelative` — verifies POM 4.1.0 `<source>` targetPath stays relative through SourceRoot API and compat layer
- [x] Integration tests: `ProjectBuilderTest#testResourceTargetPathRemainsRelativeInCompatLayer` — verifies POM 4.0.0 `<resource>` targetPath stays relative
- [x] Manual verification: POM 4.1.0 with `<source><targetPath>META-INF/tags/rdc</targetPath></source>` now copies to `target/classes/META-INF/tags/rdc/` (was copying to `/path/to/project/META-INF/tags/rdc/`)
- [x] Existing test suites pass for `impl/maven-impl` and `impl/maven-core`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix Source.targetPath incorrectly aligned to basedir [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet merged PR #12206:
URL: https://github.com/apache/maven/pull/12206
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix Source.targetPath incorrectly aligned to basedir [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #12206:
URL: https://github.com/apache/maven/pull/12206#issuecomment-4619879504
This PR has been rebased onto master and now includes consolidated test coverage from both #12206 and #12178 (which has been closed as duplicate). The failing commit from the earlier review has been dropped. @Bukama could you re-review? CI should be clean now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix Source.targetPath incorrectly aligned to basedir [maven]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12206:
URL: https://github.com/apache/maven/pull/12206#issuecomment-4624992701
@gnodet Please assign appropriate label to PR according to the type of change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix Source.targetPath incorrectly aligned to basedir [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #12206:
URL: https://github.com/apache/maven/pull/12206#issuecomment-4613613180
The second commit (test isolation fix) has been dropped — it referenced static fields that only existed in an older version of the codebase and was causing compilation failures on master. The PR is now a single clean commit fixing only the `Source.targetPath` alignment issue.
CI is fully green (19/19 checks pass).
@Bukama could you re-review? The changes-requested items should be addressed by dropping that commit entirely.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org