Maven Dependency Tree

0

I'm having some version conflict issues in my project dependencies, and the mvn dependency:tree command is not working enough because I have a lot of dependencies and it's hard to identify which dependencies depend on the conflicting library. Is there a more objective command?

    
asked by anonymous 05.04.2018 / 16:36

1 answer

1

According to the maven documentation / a>, there is the command:

mvn dependency:tree -Dverbose -Dincludes=<biblioteca>

They will specifically return the dependencies that depend on the informed library.

An important detail for this situation is the -Dverbose attribute, which instructs the dependency tree to display conflicting dependencies. That is, you will have information like omitted for conflict with 2.0 that will help you find the conflicts. However, this attribute is only usable in Maven 2.0, because in version 3.0 of Maven the use of -Dverbose may result in some problems according to documentation :

  

verbose Whether to include omitted nodes in the serialized dependency   tree. Notice this feature actually uses Maven 2 algorithm and may give   wrong results when used with Maven 3.

That's why when you run the complete command above in Maven 2.0 you might notice the message:

  

Using Maven 2 dependency tree to get verbose output, which may be inconsistent with current Maven 3 resolution

    
05.04.2018 / 16:36