Skip to content

fix(manifest): keep Maven dependencies left under a sibling's test-jar - #1684

Open
Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 1 commit into
v1.xfrom
jfblaa/rea-1055-maven-facts-dependencies-maven-keeps-under-a-siblings-test
Open

Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 1 commit into
v1.xfrom
jfblaa/rea-1055-maven-facts-dependencies-maven-keeps-under-a-siblings-test

Conversation

@jfblaa

@jfblaa Jeppe Fredsgaard Blaabjerg (jfblaa) commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

LLM Description written by Claude Code:claude-opus-5-5

REA-1055. Maven facts dropped a module's dependencies when it reached a sibling through both its jar and its test-jar and Maven kept those dependencies under the test-jar only. The walk now visits each artifact once instead of each node.

Tested: run-compat.sh maven (3.2.5 to 4.0.0-rc-6). The fixture adds this shape (app → mid → lib, plus lib's test-jar); its new check fails on v1.x.

🤖 Generated with Claude Code


Note

Medium Risk
Changes Maven dependency-tree emission logic used for SBOMs and reachability; scope is narrow (visit deduplication) but incorrect graphs would affect scan completeness.

Overview
Fixes Maven Socket facts / SBOM generation dropping transitive dependencies when a reactor module is reachable through both its normal jar (e.g. via another module) and its test-jar, and Maven attaches those transitives only under the test-jar node.

In SocketFactsRecordsEngine.visit, deduplication for the graph walk now keys the visited set on externalId (full coordinate, including type) instead of the emitted node id. Reactor siblings still use bare ids for records, but jar and test-jar paths can both be walked so children recorded only on the test-jar branch (such as demo.ext:libdep under lib) are merged into the same internal component.

The maven-compat fixture adds mid → lib, lib → libdep, and app’s test-scoped lib test-jar; smoke tests assert libdep appears in app’s graph and document the scenario in CHANGELOG.

Reviewed by Cursor Bugbot for commit c4ca3eb. Configure here.

A module that reaches a sibling through both its jar and its test-jar
shares one node for both, but Maven can keep the sibling's dependencies
under the test-jar alone. The walk visited each node once, so it skipped
that subtree and the dependencies were missing from the SBOM. Key the
visited set by the full coordinate instead.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants