为了账号安全,请及时绑定邮箱和手机立即绑定

maven dependency:tree中的符号啥意思

maven dependency:tree中的符号啥意思

ABOUTYOU 2019-03-21 22:19:22
maven dependency里+- 和-有啥区别。我+-后面的项目坐标,为什么我在pom里找不到。我没有描述清楚,让人误会了。我是用的 maven dependency:tree 命令。+- com.ss.ss: xx.jar+- xxxx: xx.jar    +- xx:xx.jar\- xx: xx.jar这种形式。请问这里的+-和-什么区别。
查看完整描述

2 回答

?
达令说

TA贡献1821条经验 获得超6个赞

给你参考对比一下就明白了。截图如下:
1.maven项目中pom.xml文件的dependency hierarchy 即依赖的jar包结构图,很显然缩进的jar包是上一行jar包的子包,这些在解决jar包的冲突的时候是非常关键的。
2.第二幅图,是使用命令mvn dependency:tree -Dverbose看到的结构图,跟图1一模一样的,也是反映了jar包之间的等级关系。至于你的命令mvn dependency:tree所展现的层级数,并没有完整的展现所有的传递依赖,加上参数-Dverbose,就可以完整的展现层级依赖关系了。

https://img1.sycdn.imooc.com//5cbbd51f000139b108000470.jpg

[INFO] ------------------------------------------------------------------------

E:\Eclipse project\first_maven_project>mvn dependency:tree -Dverbose

[INFO] Scanning for projects...

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] Building first_maven_project 0.0.1-SNAPSHOT

[INFO] ------------------------------------------------------------------------

[INFO]

[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ first_maven_project ---

[INFO] com.sucre:first_maven_project:war:0.0.1-SNAPSHOT

[INFO] +- org.springframework:spring-core:jar:3.2.8.RELEASE:compile

[INFO] |  \- commons-logging:commons-logging:jar:1.1.3:compile

[INFO] +- org.springframework:spring-webmvc:jar:3.2.8.RELEASE:compile

[INFO] |  +- org.springframework:spring-beans:jar:3.2.8.RELEASE:compile

[INFO] |  |  \- (org.springframework:spring-core:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] |  +- (org.springframework:spring-context:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] |  +- (org.springframework:spring-core:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] |  +- org.springframework:spring-expression:jar:3.2.8.RELEASE:compile

[INFO] |  |  \- (org.springframework:spring-core:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] |  \- (org.springframework:spring-web:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] +- org.springframework:spring-context:jar:3.2.8.RELEASE:compile

[INFO] |  +- (org.springframework:spring-aop:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] |  +- (org.springframework:spring-beans:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] |  +- (org.springframework:spring-core:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] |  \- (org.springframework:spring-expression:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] +- org.springframework:spring-context-support:jar:3.2.8.RELEASE:compile

[INFO] |  +- (org.springframework:spring-beans:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] |  +- (org.springframework:spring-context:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] |  \- (org.springframework:spring-core:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] +- org.springframework:spring-aop:jar:3.2.8.RELEASE:compile

[INFO] |  +- aopalliance:aopalliance:jar:1.0:compile

[INFO] |  +- (org.springframework:spring-beans:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] |  \- (org.springframework:spring-core:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] +- org.springframework:spring-aspects:jar:3.2.8.RELEASE:compile

[INFO] |  \- org.aspectj:aspectjweaver:jar:1.7.4:compile

[INFO] +- org.springframework:spring-tx:jar:3.2.8.RELEASE:compile

[INFO] |  +- (org.springframework:spring-beans:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] |  \- (org.springframework:spring-core:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] +- org.springframework:spring-jdbc:jar:3.2.8.RELEASE:compile

[INFO] |  +- (org.springframework:spring-beans:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] |  +- (org.springframework:spring-core:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] |  \- (org.springframework:spring-tx:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] +- org.springframework:spring-web:jar:3.2.8.RELEASE:compile

[INFO] |  +- (org.springframework:spring-aop:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] |  +- (org.springframework:spring-beans:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] |  +- (org.springframework:spring-context:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] |  \- (org.springframework:spring-core:jar:3.2.8.RELEASE:compile - omitted for duplicate)

[INFO] +- junit:junit:jar:4.10:test

[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.1:test

[INFO] +- log4j:log4j:jar:1.2.12:compile

[INFO] +- org.slf4j:slf4j-api:jar:1.6.6:compile

[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.6:compile

[INFO] |  +- (org.slf4j:slf4j-api:jar:1.6.6:compile - omitted for duplicate)

[INFO] |  \- (log4j:log4j:jar:1.2.17:compile - omitted for conflict with 1.2.12)

[INFO] +- org.springframework:spring-test:jar:3.2.8.RELEASE:test

[INFO] |  \- (org.springframework:spring-core:jar:3.2.8.RELEASE:test - omitted for duplicate)

[INFO] +- org.mybatis:mybatis:jar:3.2.1:compile

[INFO] +- org.mybatis:mybatis-spring:jar:1.2.0:compile

[INFO] \- mysql:mysql-connector-java:jar:5.1.29:compile

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 6.589 s

[INFO] Finished at: 2016-07-07T08:03:13+08:00

[INFO] Final Memory: 9M/22M

[INFO] ------------------------------------------------------------------------

https://img1.sycdn.imooc.com//5cbbd52a0001d42708000738.jpg

查看完整回答
反对 回复 2019-04-21
?
杨__羊羊

TA贡献1943条经验 获得超7个赞

'+-' 和 '-'的区别
建议参考一下eclipsepom文件dependency Hierarchy功能

查看完整回答
反对 回复 2019-04-21
  • 2 回答
  • 0 关注
  • 1331 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信