mvn 依赖项:树并不真正显示所有依赖项

2022-09-03 07:14:41

我遇到了一个问题,编译一个包含许多依赖项的jar,特别是重叠版本(我们需要1.11,一些依赖项正在拉入1.9)。我们运行了,但我们在任何输出中都没有看到有问题的辅助版本。在进一步的检查中,是当时正在拉进来的。为什么没有向我们展示这种向下钻取级别:snakeyamlmvn dependency:treejruby-completesnakeyamlmvn 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)

为什么 jruby-complete 的依赖项没有列在树中?是否只有一定深度的 gfo?这里的规则是什么?如果只是向我们展示它的依赖关系,我们可以节省几个小时的复杂调试。mvn dependency:treemvn dependency:treesnakeyaml


答案 1

我相信这个论坛主题会回答你的问题。依赖关系树 mojo 会修剪较低级别的依赖关系(如果依赖关系已存在于树中的较高位置)。这意味着 jruby-complete 的所有依赖项(如果有的话)都列在树中较浅的深度。可以使用详细标志 () 来显示省略的依赖项。-Dverbose


答案 2

推荐