Display omitted versions in maven dependency:tree?

Yes, you can have the omitted artifacts by setting the verbose attribute to true:

Whether to include omitted nodes in the serialized dependency tree.

This attribute defaults to false. On the command line, you would have

mvn dependency:tree -Dverbose=true

According to this, the -Dverbose=true argument is ignored in versions 3.0 of the plugin and above. You need to use an older version; the above link suggests the following (works for me):

mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:tree -Dverbose=true

I suggest to use the depgraph-maven-plugin.

  • to see all dependencies, set showDuplicates to true
    • this will include dependencies that dependency:tree would show with verbose option
  • to see conflicts, set showConflicts to true
  • has various filters to include/exclude projects
  • can export to various formats, including dot file that can be rendered with GraphViz
    • I use vscode plugin GraphViz Interactive Preview to render and view dot files.

Example config:

<plugin>
    <groupId>com.github.ferstl</groupId>
    <artifactId>depgraph-maven-plugin</artifactId>
    <version>3.3.0</version>
    <configuration>
        <showDuplicates>true</showDuplicates>
        <showConflicts>true</showConflicts>
        <includes>
            <!-- groupId:artifactId:type:classifier -->
            <include>com.mycompany*:*</include>
        </includes>
    </configuration>
</plugin>

Then run mvn depgraph:graph in your project to find a new file in target/dependency-graph.dot.

Note that you can include the plugin with scope provided such that it will not be included in any build artifact.