Fix inherited versions in BOM consumer POMs - #12710
Conversation
Signed-off-by: ulofiai <monsterking@tutamail.com>
gnodet
left a comment
There was a problem hiding this comment.
Clean, well-scoped fix that correctly fills in missing dependency versions from imported BOMs in consumer POM generation. The change is narrowly guarded to BUILD_CONSUMER mode only and includes a focused unit test.
Notes:
- The five-predicate guard (
present != null,directDependencies.contains(key),BUILD_CONSUMERrequest type,present.getVersion() == null,dependency.getVersion() != null) ensures this only activates for the exact scenario reported in #12660. - No file overlap with related PR #12641, so no merge conflict risk.
- An end-to-end integration test (similar to PR #12641's
its/core-it-suite/approach) could add extra confidence, but is not blocking.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
gnodet
left a comment
There was a problem hiding this comment.
Clean, well-scoped fix that correctly fills missing dependency versions from imported BOMs during consumer POM generation. The five-predicate guard ensures this only activates for the exact scenario reported in #12660, and the unit test covers the primary use case.
Non-blocking observations:
- Consider adding negative test cases: one that verifies the version is NOT filled in for non-BUILD_CONSUMER request types, and another that verifies an existing local version is NOT overridden by a BOM version.
- No CI checks have run on this PR (merge state shows UNSTABLE). The fix should be verified via CI before merging.
This review was generated by an AI agent (Claude Code) and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of Guillaume Nodet
Fixes #12660.
When building a consumer model, retain locally declared dependency-management metadata while filling a missing version from an imported BOM. The merge is limited to BUILD_CONSUMER, so regular model import precedence and conflicting BOM imports remain unchanged.
Adds a focused regression test for a versionless managed dependency with an overridden scope.