33

I have a use-case where we want to know all the versions that a Maven project gets per dependency tree even if they are omitted.

Per maven-dependency-plugin documentation the "verbose" option has been discontinued since Maven 3 and "tree" Mojo of dependency goal is not more able to show the omitted dependencies.

I am using Maven 3.5.0 and tried using an additional installation of Maven 2.x, but that yields compatibility issues with Java 8 apps.

Is there a way to get verbose dependency tree output in Maven 3?

Vy Do
  • 46,709
  • 59
  • 215
  • 313
Arnab
  • 1,308
  • 1
  • 13
  • 18

2 Answers2

27

You can use

mvn dependency:tree -X

which produces the debug output.

Otherwise stated in the documentation about verbose -

Notice this feature actually uses Maven 2 algorithm and may give wrong results when used with Maven 3.

Edit: As pointed by Brad in the comments, the verbose flag has been reintroduced for the 3.2.0 release and further.

Naman
  • 27,789
  • 26
  • 218
  • 353
0

The -verbose flag was updated in version 3.2.0 of the Maven Dependency Plugin to work correctly with Maven 3, per MDEP-644.

Using this version of the plugin or newer will ensure that it returns correct results.

mvn dependency:tree -Dverbose
M. Justin
  • 14,487
  • 7
  • 91
  • 130