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

   ## Summary
   Forward port of #12915 from `maven-4.0.x` to `master`.
   
   - When a BOM project declares a managed dependency without a version (e.g., 
`junit-jupiter-api` with `scope=provided`), and the version is expected to come 
from an imported BOM in the parent POM's dependency management, the consumer 
POM was generated with the dependency entry missing its version.
   - The root cause was in 
`DefaultDependencyManagementImporter.importManagement()` where `putIfAbsent` 
skips the imported entry (including its version) when a locally-declared entry 
already exists.
   - After the `putIfAbsent` call, we now check if the existing entry has a 
null version while the imported entry provides one, and merge the version from 
the import into the existing entry.
   
   Fixes #12660
   
   ## Test plan
   - [x] Unit test 
`testImportManagementInheritsVersionFromImportedBomWhenLocalEntryHasNoVersion` 
included
   - [ ] 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]

Reply via email to