Fix Source targetPath incorrectly aligned to project basedir#12178
Open
gnodet wants to merge 1 commit into
Open
Fix Source targetPath incorrectly aligned to project basedir#12178gnodet wants to merge 1 commit into
gnodet wants to merge 1 commit into
Conversation
gnodet
added a commit
that referenced
this pull request
May 28, 2026
Cherry-pick from fix/resource-targetpath branch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fde9762 to
7811510
Compare
DefaultModelPathTranslator.alignToBaseDirectory(Source) was resolving Source.targetPath against the project basedir, turning relative paths like "META-INF/tags/rdc" into absolute paths. This caused 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 correct behavior for Resource.targetPath. Added test coverage for both Source (4.1.0 model) and legacy Resource (4.0.0 model) targetPath through the compat layer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7811510 to
11c30c2
Compare
gnodet
added a commit
that referenced
this pull request
Jun 1, 2026
Cherry-pick from fix/resource-targetpath branch (squashed commit). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gnodet
added a commit
that referenced
this pull request
Jun 2, 2026
Cherry-pick from fix/resource-targetpath-compat branch. Supersedes earlier #12178 cherry-pick with expanded fix. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
DefaultModelPathTranslator.alignToBaseDirectory(Source)was incorrectly resolvingSource.targetPathagainst the project basedir, turning a relative path like.grammarinto an absolute path like/path/to/project/.grammartarget/classes)Sourcepath translation, matching the existing behavior forResource.targetPath(which is correctly not aligned)Test plan
DefaultModelPathTranslatorTest— verifies Source targetPath is NOT aligned while directory IS alignedProjectBuilderTest#testSourceTargetPathRemainsRelative— full model builder integration test with.grammarandMETA-INF/testtargetPaths, verifying both SourceRoot API and compat Resource APIPomConstructionTest#testTargetPathResourceRegression— still passesResourceIncludeTest(10 tests) — still passesDefaultSourceRootTest(13 tests) — still passesmaven-implandmaven-core(547 tests) — all passClaude Code on behalf of Guillaume Nodet
🤖 Generated with Claude Code