2016-09-23 43 views
0

我有一個像這樣具有依賴性的一個項目POM(由mvn dependency:tree報道):Maven構件的版本不匹配的定義在罐子

[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,如何行家分析它爲0.0.1-SNAPSHOT?

回答

0

com.gttown:gt-common-mybatis取決於gttown-dao-enterprise 0.0.1-SNAPSHOT,所以maven用這個版本來解決它,你可以在你的pom中排除,maven將取代1.0.0-SNPASHOT。

<artifactId>gttown-dao-enterprise</artifactId> 
<dependency> 
    <groupId>com.gttown</groupId> 
    <artifactId>gt-common-mybatis</artifactId> 
    <version>1.0.0-SNAPSHOT</version> 
    <exclusions> 
     <exclusion> 
      <groupId>com.gttown</groupId> 
      <artifactId>gt-common-util</artifactId> 
     </exclusion> 
    </exclusions> 
</dependency>