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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to