Skip to content

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

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

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

Conversation

@gnodet

@gnodet gnodet commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Backport of #13040 to maven-3.10.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.

The bug was reported against Maven 3.9.11 (#11397). The ProjectSorter code lives in maven-core/ on this branch (Maven 3 API: project.getModel().getParent() without .getDelegate()). The conflict from cherry-pick was resolved accordingly — the logic is otherwise identical to the master fix.

Fixes: #11397

@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. Logic is faithful to master, Java 8 compat preserved (Arrays.asList instead of List.of). One gap in test coverage.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@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.

Re-review of 530e539.

The -amd test added in this commit is a useful addition. However, the finding raised in the previous review — missing test for the generic property resolution branch — is not addressed by this commit. Both existing tests use ${project.version}, which exercises only the fast-path in resolveImportVersion. See inline comment.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@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.

Re-review of 6631d67.

Previous finding addressed. The importedReactorBomWithPropertyVersion() test (added in this commit) covers the generic property resolution branch of resolveImportVersion — the path I flagged as missing in the prior review.

Backport is faithful to master: resolveImportVersion is identical, the logic for iterating originalModel.getDependencyManagement() is correct, and the Maven 3 API adaptation (project.getModel().getParent() without .getDelegate()) is properly applied. Test coverage now includes all three cases: -am direction with ${project.version} fast-path, -am direction with generic property resolution, and -amd direction.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@cstamas cstamas added this to the 3.10.0 milestone Sep 24, 2026
@gnodet gnodet added the bug Something isn't working label Sep 24, 2026
…s ProjectSorter edges so -am includes them

- Register dependencyManagement BOM imports (scope=import, type=pom) as reactor graph edges in ProjectSorter
- Ensures -am / -amd correctly includes imported BOM modules in the selected reactor subset
- Fix Java 8 compatibility: replace List.of() with Arrays.asList()
- Add test coverage for -amd direction (BOM reports consumer as dependent) and arbitrary property versions
@gnodet
gnodet force-pushed the backport/13040-to-3.10.x branch from 6631d67 to 89ad1a3 Compare September 24, 2026 16:47
@gnodet
gnodet merged commit 3a0026c into apache:maven-3.10.x Sep 24, 2026
3 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