Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NETBEANS-6519] Maven dependency produces full tree with duplicates, avoids cycles. #4947

Merged
merged 2 commits into from
Nov 11, 2022

Conversation

sdedic
Copy link
Member

@sdedic sdedic commented Nov 9, 2022

See also NETBEANS-6519

The main issue with the implementation was that the 1st encountered Dependency from Maven might be truncated / stripped of its children - and marked as a duplicate. However in the dependency API all dependencies are "equal", we cannot assume that a client does depth-first or breadth-first traversal.
With the fix, the dependency tree will be enormous, as each common library dependency will introduce a full subtree at the library's place in the dependency tree.

I plan to add an additional API to mark duplicates (= subtrees with the same contents) and possibly resolution conflicts (an artifact dependency has been resolved by a different artifact, e.g. a different version of a library). But this fix is simple and allows clients to enumerate all dependencies. Clients can now filter the duplicates themselves, according to their needs.

@sdedic sdedic added Maven [ci] enable "build tools" tests enterprise [ci] enable enterprise job labels Nov 9, 2022
@sdedic sdedic added this to the NB17 milestone Nov 9, 2022
@sdedic sdedic requested a review from dbalek November 9, 2022 11:34
@sdedic sdedic self-assigned this Nov 9, 2022
@sdedic sdedic force-pushed the maven/duplicate-dependencies-fix branch 2 times, most recently from 85916d3 to 471fc1f Compare November 9, 2022 16:06
@sdedic
Copy link
Member Author

sdedic commented Nov 9, 2022

sorted dependency in the printout on each level. updated golden files.

@sdedic sdedic force-pushed the maven/duplicate-dependencies-fix branch from 7e47dbb to 2306b1b Compare November 10, 2022 15:20
@sdedic sdedic force-pushed the maven/duplicate-dependencies-fix branch from 2306b1b to 1f1afd6 Compare November 11, 2022 10:31
@sdedic
Copy link
Member Author

sdedic commented Nov 11, 2022

Finally got the test golden file right -- local machine setup implied somehow activation of graalvm profile, controlled by micronaut-parent POM.
The most tricky part was to disable Maven's global cache - NetBeans do the same at runtime.

@sdedic sdedic merged commit 4a697ab into apache:master Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enterprise [ci] enable enterprise job Maven [ci] enable "build tools" tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants