How can I view transitive dependencies of a Maven pom.xml file?

后端 未结 1 938
北荒
北荒 2020-12-08 06:11

Is there a CLI tool I can use to quickly view the transitive dependencies of a Maven pom.xml file?

1条回答
  •  不知归路
    2020-12-08 06:58

    On the CLI, use mvn dependency:tree
    (Here are some additional Usage notes)

    When running dependency:tree on multi-module maven project, use mvn compile dependency:tree instead1.

    Otherwise, the POM Editor in M2Eclipse (Maven integration for Eclipse) is very good, and it includes a hierarchical dependency view.


    1If you don't compile, you might get error Failed to execute goal on project baseproject: Could not resolve dependencies for project com.company:childproject:jar:1.0.0: Could not find artifact. This might happen because dependency:tree command doesn't build projects and doesn't resolve dependencies, and your projects are not installed in maven repository.

    0 讨论(0)
提交回复
热议问题