waterWang opened a new pull request, #12728:
URL: https://github.com/apache/maven/pull/12728
### Problem
`DefaultProfileActivationContext.stop()` filters out `false`-valued entries
from `usedActiveProfiles` and `usedInactiveProfiles` before freezing the
`Record`. This means a parent POM assembled without `-Prelease` stores an empty
map (`usedActiveProfiles = {}`), which matches ANY context — including one
where `-Prelease` is active. The poisoned cache entry is then shared by every
reactor module, causing profile-injected content (plugin executions,
properties, dependencies) to silently vanish from a subset of modules.
Root cause: the cache key is too narrow — it only records profiles that were
*active*, not profiles that were consulted but found *inactive*.
### Fix
Remove the two `removeIf` filters so every consulted profile key is
retained, regardless of whether it evaluated to `true` or `false`. The
`Record.matches()` method already correctly verifies keys it holds, so a
`false`-valued entry correctly prevents a mis-match.
### Test
Added `ParentProfileCacheTest` with two assertions that fail on the
unpatched code and pass with the fix:
- A parent assembled without `-Prelease` must not be reused for a module
built with `-Prelease`
- A parent assembled without `-!release` must not be reused for a module
built with `-!release`
### References
Full root-cause analysis: https://github.com/apache/maven/issues/12724
--
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]