mvn依赖:树并没有真正显示所有依赖关系

时间:2016-03-16 23:25:40

标签: java maven tree

我遇到了一个问题,编译了一个包含许多依赖关系的jar,特别是snakeyaml的重叠版本(我们需要1.11,一些依赖关系在1.9中引入)。我们运行mvn dependency:tree,但我们没有在任何输出中看到有问题的二级版本。在进一步检查时,jruby-completesnakeyaml然后进入mvn dependency:tree。为什么没有[INFO] | | +- org.apache.hbase:hbase-it:jar:0.98.6-cdh5.2.5:compile [INFO] | | | +- (org.apache.hbase:hbase-common:jar:0.98.6-cdh5.2.5:compile - omitted for duplicate) [INFO] | | | +- (org.apache.hbase:hbase-protocol:jar:0.98.6-cdh5.2.5:compile - omitted for duplicate) [INFO] | | | +- (org.apache.hbase:hbase-client:jar:0.98.6-cdh5.2.5:compile - omitted for duplicate) [INFO] | | | +- org.apache.hbase:hbase-shell:jar:0.98.6-cdh5.2.5:compile [INFO] | | | | +- (org.apache.hbase:hbase-common:jar:0.98.6-cdh5.2.5:compile - omitted for duplicate) [INFO] | | | | +- (org.apache.hbase:hbase-protocol:jar:0.98.6-cdh5.2.5:compile - omitted for duplicate) [INFO] | | | | +- (org.apache.hbase:hbase-client:jar:0.98.6-cdh5.2.5:compile - omitted for duplicate) [INFO] | | | | +- (org.apache.hbase:hbase-prefix-tree:jar:0.98.6-cdh5.2.5:runtime - omitted for duplicate) [INFO] | | | | +- (org.apache.hbase:hbase-server:jar:0.98.6-cdh5.2.5:compile - omitted for duplicate) [INFO] | | | | +- (org.apache.hbase:hbase-hadoop-compat:jar:0.98.6-cdh5.2.5:compile - omitted for duplicate) [INFO] | | | | +- (org.apache.hbase:hbase-hadoop2-compat:jar:0.98.6-cdh5.2.5:compile - omitted for duplicate) [INFO] | | | | +- (com.yammer.metrics:metrics-core:jar:2.2.0:compile - omitted for duplicate) [INFO] | | | | +- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for conflict with 1.2) [INFO] | | | | +- org.jruby:jruby-complete:jar:1.6.8:compile >>>>>>> WHY ARE THERE NO DEPENDENCIES HERE? >>>>>>>>> [INFO] | | | | +- (org.cloudera.htrace:htrace-core:jar:2.04:compile - omitted for duplicate) [INFO] | | | | +- (org.apache.hadoop:hadoop-common:jar:2.5.0-cdh5.2.5:compile - omitted for duplicate) 向我们展示这种级别的下钻:

mvn dependency:tree

为什么树中没有列出the dependencies of jruby-completemvn dependency:tree只有gfo到一定深度吗?这里的规则是什么?如果snakeyaml只是向我们显示了tempHash + salt依赖关系,那么我们可以节省几个小时的复杂调试。

1 个答案:

答案 0 :(得分:6)

我相信this forum topic会回答你的问题。如果依赖性已经在树中更高地存在,则依赖性树mojo修剪较低级别的依赖性。这意味着所有jruby-complete的依赖项(如果有的话)都列在树的较浅深度。您可以使用verbose flag-Dverbose)来显示已省略的依赖项。