gnodet opened a new pull request, #12621: URL: https://github.com/apache/maven/pull/12621
## Summary This PR incorporates the fix from #12617 (by @desruisseaux) and adds the regression test requested in the [review](https://github.com/apache/maven/pull/12617#pullrequestreview-4811043754). - **Commit 1** (from #12617): Removes the `needRelativize` optimization in `PathSelector` that skipped path relativization when all patterns started with `**`. The optimization produced false positives when the base directory path itself contained a segment matching the pattern. - **Commit 2**: Adds a regression test `testNoFalsePositiveWhenBaseDirectoryMatchesPattern` that constructs the exact scenario from the PR description — base directory `something/target/test-classes` with pattern `**/test-classes/**` falsely matching files in sibling directories. Supersedes #12617 (maintainer push was disabled on the fork, so the test could not be added directly to that PR). ## Test plan - [x] New test fails without the fix (false positive confirmed) - [x] All 6 `PathSelectorTest` tests pass with the fix - [ ] CI passes 🤖 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]
