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

fix: use the first version when a dependency is listed multiple times in pom.xml files #229

Closed
wants to merge 1 commit into from

Conversation

G-Rath
Copy link
Owner

@G-Rath G-Rath commented Oct 13, 2023

Per https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Transitive_Dependencies

Note that if two dependency versions are at the same depth in the dependency tree, the first declaration wins.

It doesn't seem to explicitly mention what happens when there are duplicate packages for dependency management so I've assumed it follows the same behaviour.

@G-Rath G-Rath added the bug Something isn't working label Oct 13, 2023
@G-Rath
Copy link
Owner Author

G-Rath commented Oct 16, 2023

Turns out that Maven itself doesn't follow this so for now let's keep it as-is since that's the more real-world behaviour.

See google/osv-scanner#589 (comment)

@G-Rath G-Rath closed this Oct 16, 2023
@G-Rath G-Rath deleted the improve-maven branch October 16, 2023 01:50
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.

1 participant