【发布时间】:2017-02-01 00:12:22
【问题描述】:
我有一个带有依赖项的项目 pom(由mvn dependency:tree 报告),如下所示:
[INFO] +- com.gttown:gttown-dao-enterprise:jar:0.0.1-SNAPSHOT:compile
[INFO] | +- com.gttown:gt-common-mybatis:jar:0.0.1-SNAPSHOT:compile
[INFO] | | +- org.mybatis.generator:mybatis-generator-core:jar:1.3.2:compile
[INFO] | | +- org.springframework:spring-jdbc:jar:4.2.4.RELEASE:compile
[INFO] | | \- org.springframework:spring-tx:jar:4.2.4.RELEASE:compile
[INFO] | \- com.gttown:gt-common-util:jar:0.0.1-SNAPSHOT:compile
它依赖于gttown-dao-enterprise 0.0.1-SNAPSHOT,它间接依赖于gt-common-util 0.0.1-SNAPSHOT。但我确实将gttown-dao-enterprise 0.0.1-SNAPSHOT 中gt-common-util 的版本定义为1.0.0-SNAPSHOT
<artifactId>gttown-dao-enterprise</artifactId>
<dependencies>
<dependency>
<groupId>com.gttown</groupId>
<artifactId>gt-common-util</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
...
</dependencies>
理论上在项目pom中出现的最终版本应该是1.0.0-SNAPSHOT,maven怎么分析为0.0.1-SNAPSHOT?
【问题讨论】: