在maven依赖项中显示省略的版本:树?

Rob*_*ser 11 java eclipse pom.xml maven maven-dependency-plugin

在Eclipse中,当我转到Maven Dependency Hierarchy页面时,我得到输出,指出导致版本被忽略的冲突:

eclipse maven版本

但是,如果我使用dependency:tree,那就省略了,我只看到实际使用的evrsions:

|  +- commons-httpclient:commons-httpclient:jar:3.1:compile
|  +- commons-codec:commons-codec:jar:1.4:compile
|  +- commons-io:commons-io:jar:2.4:compile
|  +- commons-net:commons-net:jar:3.1:compile
|  +- javax.servlet:servlet-api:jar:2.5:compile
Run Code Online (Sandbox Code Playgroud)

后来实际引用的版本......

+- commons-collections:commons-collections:jar:3.1:compile
Run Code Online (Sandbox Code Playgroud)

有没有办法获得依赖:树输出省略冲突的版本?

谢谢!

Tun*_*aki 13

是的,您可以通过将verbose属性设置为true:来获取省略的工件:

是否在序列化依赖关系树中包含省略的节点.

此属性默认为false.在命令行上,你会有

mvn dependency:tree -Dverbose=true
Run Code Online (Sandbox Code Playgroud)

  • 这只适用于依赖插件版本3.0.使用3.1,您必须使用选项-X.但是你仍然没有看到遗漏的依赖项.那我该怎么办? (5认同)
  • 我发现的唯一选择是使用旧版本的依赖插件:`mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:tree -Dverbose=true`。但是有一个警告:“使用 Maven 2 依赖树获取详细输出,这可能与实际的 Maven 3 分辨率不一致”。总比没有好。 (2认同)