mvn dependency:tree 打印依赖树
mvn dependency:tree > a.txt 将依赖树打印到文件中
mvn dependency:tree -Dincludes=com.alibaba:fastjson打印包含某些包的依赖树
mvn dependency:tree>tree.txt -Dverbose 使用verbose参数可以看冲突和重复的具体情况:
mvn dependency:tree -Dverbose -Dincludes=com.alibaba:fastjson > a.txt 打印忽略信息(解决冲突)
[[1;34mINFO[m] JD:JD_test:jar:1.0-SNAPSHOT [[1;34mINFO[m] +- junit:junit:jar:4.11:test [[1;34mINFO[m] | - org.hamcrest:hamcrest-core:jar:1.3:test [[1;34mINFO[m] +- org.springframework:spring-core:jar:4.3.8.RELEASE:compile [[1;34mINFO[m] | - commons-logging:commons-logging:jar:1.2:compile [[1;34mINFO[m] +- org.springframework:spring-beans:jar:4.3.8.RELEASE:compile [[1;34mINFO[m] +- org.springframework:spring-context-support:jar:4.3.8.RELEASE:compile [[1;34mINFO[m] | - org.springframework:spring-context:jar:4.3.8.RELEASE:compile [[1;34mINFO[m] | - org.springframework:spring-expression:jar:4.3.8.RELEASE:compile [[1;34mINFO[m] +- org.springframework:spring-aop:jar:4.3.8.RELEASE:compile [[1;34mINFO[m] +- org.springframework:spring-aspects:jar:4.3.8.RELEASE:compile [[1;34mINFO[m] | - org.aspectj:aspectjweaver:jar:1.8.9:compile [[1;34mINFO[m] +- org.springframework:spring-jdbc:jar:4.3.8.RELEASE:compile [[1;34mINFO[m] | - org.springframework:spring-tx:jar:4.3.8.RELEASE:compile [[1;34mINFO[m] +- org.springframework:spring-test:jar:4.3.8.RELEASE:provided [[1;34mINFO[m] +- mysql:mysql-connector-java:jar:6.0.6:compile [[1;34mINFO[m] +- org.apache.hive:hive-jdbc:jar:2.3.2:compile [[1;34mINFO[m] | +- org.apache.hive:hive-common:jar:2.3.2:compile [[1;34mINFO[m] | | +- org.apache.hive:hive-storage-api:jar:2.4.0:compile [[1;34mINFO[m] | | +- org.apache.commons:commons-lang3:jar:3.1:compile [[1;34mINFO[m] | | +- org.apache.orc:orc-core:jar:1.3.3:compile [[1;34mINFO[m] | | | - io.airlift:aircompressor:jar:0.3:compile
其中
“±”符号表示该包后面还有其它依赖包,
“-”表示该包后面不再依赖其它jar包



