Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven dependency tree - version managed

Tags:

maven

pom.xml

In my project I see the following when issuing mvn dependency:tree -Dverbose:

[INFO] |  |  \- xalan:xalan:jar:2.7.2:compile (version managed from 2.7.0) [INFO] |  |     \- xalan:serializer:jar:2.7.2:compile 

Does this version managed mean Xalan 2.7.2 overrides 2.7.0?

Note: In my parent pom I have 2.7.2 under dependencyManagement.

like image 559
Hari Rao Avatar asked Jul 27 '15 13:07

Hari Rao


People also ask

How do I exclude a specific version of a dependency in Maven?

Multiple transitive dependencies can be excluded by using the <exclusion> tag for each of the dependency you want to exclude and placing all these exclusion tags inside the <exclusions> tag in pom. xml. You will need to mention the group id and artifact id of the dependency you wish to exclude in the exclusion tag.

How does Maven handle conflicting dependencies?

Enforcer can help developers solve dependency conflicts in Maven by analyzing all libraries declared in the POM file. The plugin uses a lot of different rules, but we are only interested in one: dependencyConvergence – ensures all dependencies converge to the same version.

How do you resolve a version collision of artifacts in Maven?

One way to resolve a version collision is by removing a conflicting transitive dependency from specific artifacts. In our example, we don't want to have the com. google. guava library transitively added from the project-a artifact.


1 Answers

Yes, your understanding is correct.

like image 110
dunni Avatar answered Sep 19 '22 18:09

dunni