Maven 的依赖排查的几个命令

Maven 的依赖排查的几个命令

maven 的依赖排查的几个命令:

– mvn dependency:tree
说明:打印输出 Maven项目的所有依赖的POM中定义的jar
查看【输出示例1】

– mvn dependency:tree -Dverbose > d:/tmp/mvn-dependency-tree-verbose.out.txt
说明: 打印输出Maven项目的所有依赖的POM jar,但是增加verbose的参数,含有更多详细输出。
查看【输出示例2】

– mvn dependency:tree -Dverbose -Dincludes=org.slf4j > d:/tmp/mvn-dependency-tree-verbose-includes.out.txt
说明: 打印输出依赖POM jar, 但是有过滤性的输出。
查看【输出示例3】

 

参考一篇博客,通过 #mvn dependency:tree解决 java project中jar包冲突的问题:

Maven类包冲突终极三大解决技巧 mvn dependency:tree (https://blog.csdn.net/sun_wangdong/article/details/51852113)

 

【输出示例1】
[INFO] +- com.stormzhange.risky.rcomss.common.facade:risky-rcomss-common-facade:jar:2.2.1-20180426-SNAPSHOT:compile
[INFO] | \- com.stormzhange.risky.rcfs:risky-rcfs-api:jar:1.0.1-SNAPSHOT:compile
[INFO] | +- com.stormzhange.risky.common:risky-sharding:jar:1.4.0-SNAPSHOT:compile
[INFO] | | +- org.xerial.snappy:snappy- java:jar:1.1.2.4:compile
[INFO] | | \- com.alibaba:dubbo:jar:2.5.5:compile
[INFO] | | +- org. javassist: javassist:jar:3.20.0-GA:compile
[INFO] | | \- org.jboss.netty:netty:jar:3.2.5.Final:compile
[INFO] | +- com.stormzhange.risky.rcfs.common.facade:risky-rcfs-common-facade:jar:1.0.2-20170216-SNAPSHOT:compile
[INFO] | +- redis.clients:jedis:jar:2.9.0:compile
[INFO] | | \- org.apache.commons:commons-pool2:jar:2.4.2:compile
[INFO] | +- org.springframework.data:spring-data-redis:jar:1.8.9.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-keyvalue:jar:1.2.9.RELEASE:compile
[INFO] | | | \- org.springframework.data:spring-data-commons:jar:1.13.9.RELEASE:compile
[INFO] | | \- org.springframework:spring-oxm:jar:4.3.13.RELEASE:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] | +- org.apache.commons:commons-collections4:jar:4.1:compile
[INFO] | \- javax.inject: javax.inject:jar:1:compile
[INFO] +- org.apache.poi:poi:jar:3.9:compile
[INFO] | \- commons-codec:commons-codec:jar:1.5:compile
[INFO] \- org.apache.poi:poi-ooxml:jar:3.9:compile
[INFO] +- org.apache.poi:poi-ooxml-schemas:jar:3.9:compile
[INFO] | \- org.apache.xmlbeans:xmlbeans:jar:2.3.0:compile
[INFO] | \- stax:stax-api:jar:1.0.1:compile
[INFO] \- dom4j:dom4j:jar:1.6.1:compile
[INFO] \- xml-apis:xml-apis:jar:1.0.b2:compile

【输出示例2】
[INFO] +- com.google.guava:guava:jar:16.0:compile
[INFO] \- com.stormzhange.risky.rcfs:risky-rcfs-api:jar:1.0.1-SNAPSHOT:compile
[INFO] +- com.stormzhange.risky.common:risky-sharding:jar:1.4.0-SNAPSHOT:compile (version managed from 0.9.0-SNAPSHOT)
[INFO] | +- (com.stormzhange.common:common:jar:1.3.1:compile – omitted for duplicate)
[INFO] | +- (commons-lang:commons-lang:jar:2.6:compile – omitted for duplicate)
[INFO] | +- org.xerial.snappy:snappy- java:jar:1.1.2.4:compile
[INFO] | +- (org.springframework:spring-context:jar:4.3.3.RELEASE:compile – version managed from 3.2.3.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile – omitted for duplicate)
[INFO] | +- org.springframework:spring-tx:jar:4.3.3.RELEASE:compile
[INFO] | | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile – omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile – omitted for duplicate)
[INFO] | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile – omitted for duplicate)
[INFO] | +- (org.springframework.data:spring-data-redis:jar:1.8.9.RELEASE:compile – version managed from 1.6.2.RELEASE; omitted for duplicate)
[INFO] | +- (redis.clients:jedis:jar:2.9.0:compile – version managed from 2.7.0; omitted for duplicate)
[INFO] | +- (com.google.code.gson:gson:jar:2.2.4:compile – omitted for duplicate)
[INFO] | \- com.alibaba:dubbo:jar:2.5.5:compile (version managed from 2.5.3.4)
[INFO] | +- (org.springframework:spring-context:jar:4.3.3.RELEASE:compile – version managed from 4.3.10.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile – version managed from 4.3.10.RELEASE; omitted for duplicate)
[INFO] | +- org.springframework:spring-web:jar:4.3.3.RELEASE:compile (version managed from 4.3.10.RELEASE)
[INFO] | | +- (org.springframework:spring-aop:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile – version managed from 4.3.10.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-context:jar:4.3.3.RELEASE:compile – version managed from 4.3.10.RELEASE; omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | +- org. javassist: javassist:jar:3.20.0-GA:compile
[INFO] | \- org.jboss.netty:netty:jar:3.2.5.Final:compile
[INFO] +- com.stormzhange.risky.rcfs.common.facade:risky-rcfs-common-facade:jar:1.0.2-20170216-SNAPSHOT:compile (version managed from 1.0.2-20161117-SNAPSHOT)
[INFO] | +- (commons-lang:commons-lang:jar:2.6:compile – omitted for duplicate)
[INFO] | \- (com.stormzhange.risky.common:risky-common:jar:1.3.0-20171214-01:compile – version managed from 1.2.12-20160225.2; omitted for duplicate)
[INFO] +- redis.clients:jedis:jar:2.9.0:compile
[INFO] | \- org.apache.commons:commons-pool2:jar:2.4.2:compile
[INFO] +- org.springframework.data:spring-data-redis:jar:1.8.9.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-keyvalue:jar:1.2.9.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:1.13.9.RELEASE:compile
[INFO] | | | +- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | | | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | | | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – version managed from 1.7.25; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-context:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-tx:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – version managed from 1.7.25; omitted for duplicate)
[INFO] | +- (org.springframework:spring-tx:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | +- org.springframework:spring-oxm:jar:4.3.13.RELEASE:compile
[INFO] | | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-aop:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | +- org.springframework:spring-context-support:jar:4.3.3.RELEASE:compile (version managed from 4.3.13.RELEASE)
[INFO] | | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-context:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – version managed from 1.7.25; omitted for duplicate)
[INFO] +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] +- org.apache.commons:commons-collections4:jar:4.1:compile
[INFO] +- (com.google.guava:guava:jar:16.0:compile – omitted for duplicate)
[INFO] \- javax.inject: javax.inject:jar:1:compile

【输出示例3】
[INFO]
[INFO] — maven-dependency-plugin:2.8:tree (default-cli) @ risky-rcomss-common-dal —
[INFO] com.stormzhange.risky.rcomss.common.dal:risky-rcomss-common-dal:jar:1.0
[INFO] \- com.stormzhange.risky.rcomss.common.util:risky-rcomss-common-util:jar:1.0:compile
[INFO] +- com.stormzhange.risky.common:risky-common:jar:1.3.0-20171214-01:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.5:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.0.13:compile
[INFO] | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – omitted for duplicate)
[INFO] +- org.slf4j:jcl-over-slf4j:jar:1.7.5:compile
[INFO] | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – omitted for duplicate)
[INFO] +- com.pingan.zues:zues-utility-logging:jar:1.2.8:compile
[INFO] | +- (org.slf4j:slf4j-api:jar:1.7.5:compile – omitted for duplicate)
[INFO] | +- (org.slf4j:jcl-over-slf4j:jar:1.7.5:compile – omitted for duplicate)
[INFO] | +- (org.slf4j:log4j-over-slf4j:jar:1.7.5:compile – omitted for duplicate)
[INFO] | \- com.pingan.zues:zues-utility-common:jar:1.2.1:compile
[INFO] | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – omitted for duplicate)
[INFO] +- org.slf4j:log4j-over-slf4j:jar:1.7.5:compile
[INFO] | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – omitted for duplicate)
[INFO] \- com.stormzhange.risky.rcomss.common.facade:risky-rcomss-common-facade:jar:2.2.1-20180426-SNAPSHOT:compile
[INFO] \- com.stormzhange.risky.rcfs:risky-rcfs-api:jar:1.0.1-SNAPSHOT:compile
[INFO] \- org.springframework.data:spring-data-redis:jar:1.8.9.RELEASE:compile
[INFO] +- org.springframework.data:spring-data-keyvalue:jar:1.2.9.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-commons:jar:1.13.9.RELEASE:compile
[INFO] | | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – version managed from 1.7.25; omitted for duplicate)
[INFO] | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – version managed from 1.7.25; omitted for duplicate)
[INFO] \- (org.slf4j:slf4j-api:jar:1.7.5:compile – version managed from 1.7.25; omitted for duplicate)
[INFO]

More from my site

好烂啊有点差凑合看看还不错很精彩 (No Ratings Yet)
Loading...
41 views

发表评论

电子邮件地址不会被公开。 必填项已用*标注

跳至工具栏