Backport #13040: treat reactor BOM imports as ProjectSorter edges so -am includes them - #13262
Conversation
… -am includes them Treat `dependencyManagement` BOM imports (`scope=import, type=pom`) from the original project model as reactor graph edges in `ProjectSorter`, so that `-am` / `-amd` correctly includes imported BOM modules in the selected reactor subset. Resolves: apache#11397 The single IT failure on `integration-tests (ubuntu-latest, 21)` is `MavenITmng0095ReactorFailureBehaviorTest.testitFailAtEnd`, a known flaky test unrelated to this change (passes on all other 8 matrix combinations including ubuntu/17, ubuntu/25, windows/21, macos/21).
gnodet-bot
left a comment
There was a problem hiding this comment.
Clean backport of #13040 to maven-4.0.x. Logic is identical to the already-merged master version — the cherry-pick applies without conflicts as stated, resolveImportVersion is safe with null/unresolvable versions (falls back to the "match all" path in addEdge), and the test covers the primary scenario (${project.version} expression resolved to a reactor BOM member). The FQN usage of org.apache.maven.model.Model/Dependency matches the accepted master pattern and is necessary to avoid shadowing the existing org.apache.maven.api.model.Dependency import.
The two static-analysis findings (empty-catch-block in addEdge, mutable-collection-return in getSortedProjects/getProjectMap) are pre-existing — not introduced by this PR.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Backport of #13040 to
maven-4.0.x.Treat
dependencyManagementBOM imports (scope=import, type=pom) from the original project model as reactor graph edges inProjectSorter, so that-am/-amdcorrectly includes imported BOM modules in the selected reactor subset.ProjectSorteris identical betweenmasterandmaven-4.0.x— cherry-pick applies cleanly with no conflicts.Fixes: #11397