gnodet opened a new pull request, #12915: URL: https://github.com/apache/maven/pull/12915
## Summary - 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. ## Test plan - [x] Added unit test `testImportManagementInheritsVersionFromImportedBomWhenLocalEntryHasNoVersion` that verifies a local dep mgmt entry with `scope=provided` but no version gets the version merged from an imported BOM while preserving its scope. - [ ] 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]
