gnodet opened a new pull request, #12178: URL: https://github.com/apache/maven/pull/12178
## Summary - `DefaultModelPathTranslator.alignToBaseDirectory(Source)` was incorrectly resolving `Source.targetPath` against the project basedir, turning a relative path like `.grammar` into an absolute path like `/path/to/project/.grammar` - This caused the maven-resources-plugin to write files to incorrect absolute locations instead of relative to the output directory (`target/classes`) - Removed the targetPath alignment from `Source` path translation, matching the existing behavior for `Resource.targetPath` (which is correctly not aligned) ## Test plan - [x] New `DefaultModelPathTranslatorTest` — verifies Source targetPath is NOT aligned while directory IS aligned - [x] New `ProjectBuilderTest#testSourceTargetPathRemainsRelative` — full model builder integration test with `.grammar` and `META-INF/test` targetPaths, verifying both SourceRoot API and compat Resource API - [x] Existing `PomConstructionTest#testTargetPathResourceRegression` — still passes - [x] Existing `ResourceIncludeTest` (10 tests) — still passes - [x] Existing `DefaultSourceRootTest` (13 tests) — still passes - [x] Full test suite for `maven-impl` and `maven-core` (547 tests) — all pass _Claude Code on behalf of Guillaume Nodet_ 🤖 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
