Skip to content

Backport #13040: treat reactor BOM imports as ProjectSorter edges so -am includes them - #13262

Merged
gnodet merged 1 commit into
apache:maven-4.0.xfrom
gnodet:backport/13040-to-4.0.x
Sep 24, 2026
Merged

gnodet merged 1 commit into
apache:maven-4.0.xfrom
gnodet:backport/13040-to-4.0.x

Conversation

@gnodet

@gnodet gnodet commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Backport of #13040 to maven-4.0.x.

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.

ProjectSorter is identical between master and maven-4.0.x — cherry-pick applies cleanly with no conflicts.

Fixes: #11397

… -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 gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@gnodet gnodet added the bug Something isn't working label Sep 24, 2026
@gnodet gnodet added this to the 4.0.0 milestone Sep 24, 2026
@gnodet
gnodet merged commit 3ab2368 into apache:maven-4.0.x Sep 24, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants