gnodet opened a new pull request, #12641:
URL: https://github.com/apache/maven/pull/12641

   ## Summary
   
   - Fixes the BOM packaging issue where the consumer POM included all 
inherited dependency management entries from the parent chain
   - Uses a hybrid raw-model + effective-model approach: the raw model (no 
inheritance) determines **which** entries belong in the BOM, while the 
effective model provides resolved/interpolated values
   - Import-scoped BOM entries are preserved as references (not flattened) with 
versions interpolated from the project's properties
   - Adds an IT reproducing Karl's scenario: parent declares dep management 
entries, BOM module declares only its own modules — verifies inherited entries 
don't leak into the consumer BOM
   
   ## Context
   
   The previous fix 
([`4032fc8`](https://github.com/apache/maven/commit/4032fc8225c879c86245a232787802efcece5d74))
 switched from `getRawModel()` to `getEffectiveModel()` to solve dangling 
`${...}` property references in the consumer BOM. That fixed property 
resolution but caused `getEffectiveModel()` to include ALL inherited dependency 
management entries from the parent POM chain — exactly the issue [Karl 
reported](https://github.com/apache/maven/issues/12640).
   
   The new `filterToOwnDependencyManagement()` method intersects both models:
   1. **Raw model** → set of declared dependency keys (no inheritance)
   2. **Effective model** → resolved values for non-import entries
   3. **Import entries** → preserved as BOM references with version resolved 
from `project.getProperties()`
   
   ## Test plan
   
   - [ ] `MavenITgh12640BomInheritedDepMgmtTest` — verifies inherited entries 
don't leak (new)
   - [ ] `MavenITBomConsumerPomPropertyResolutionTest` — property resolution 
still works (existing, 3 tests)
   - [ ] `MavenITgh11427BomConsumerPomTest` — BOM packaging transform still 
works (existing)
   - [ ] `MavenITmng8293BomImportFromReactor` — reactor BOM import still works 
(existing)
   - [ ] `MavenITConsumerPomBomFromSettingsRepoTest` — settings repo BOM still 
works (existing)
   - [ ] 5 additional consumer POM ITs all pass with zero regressions
   
   All 16 tests pass locally.
   
   🤖 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