我有更新從屬同級項目的依賴版本的問題。如何使用版本Maven插件更新從屬同級模塊的版本
我的簡化項目設置如下。
root
|--parent
|--tool-core
|--tool
|--functional-tests
父項目包含所有全局屬性和依賴項管理。功能測試取決於工具,而工具取決於工具內核。根目錄pom.xml
僅聚合(指定是否包含功能測試)並且父項目是所有項目的父項目。我不知道這是否微不足道,但父母並未包含在聚合中,因爲它已經是每個子項目的父項。
現在,我的問題是,如果我改變工具的版本versions:set
。工具版本已更改,但對該工具的任何依賴關係均未更改。我應該怎麼做?我已經嘗試了或多或少隨機的其他目標,並嘗試閱讀手冊。
我已經嘗試過使用<dependencyManagement>
部分並在父級版本中使用屬性,但這些屬性不會更新爲新版本。
任何幫助真的很感激。
加成
我得到一個消息 「忽略反應器的依賴:com.tool:工具:罐子:空:1.2.3」 的最好的。這是當我嘗試versions:use-latest-releases
。但versions:display-dependency-updates
確實顯示「本地依賴項」上有更新(功能測試取決於工具)。
更新
看來,Maven的做新版本從儲存庫,包括當地一個現在,我想它似乎很明顯查找。但是,這意味着必須在更新依賴關係之前將該工具構建並安裝到本地存儲庫。
我只是想知道這是否是作爲自己的項目進行集成測試的正確方法。我希望能夠立即更新版本。
更新
基本上我有以下設置。 tool
的functional-tests
版本依賴項由parent
項目定義。我省略了tool-core
,因爲它可以作爲tool
的一部分進行處理。
根:
<groupId>com.somecompany</groupId>
<artifactId>x-reactor</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<profiles>
<profile>
<id>cli</id>
<modules>
<module>tool</module>
</modules>
</profile>
<profile>
<id>deploy</id>
<modules>
<module>tool</module>
<module>functional-tests</module>
</modules>
</profile>
</profiles>
父:
<groupId>com.somecompany</groupId>
<artifactId>x-parent</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.somecompany</groupId>
<artifactId>tool</artifactId>
<version>3.2.3</version>
</dependency>
</dependencies>
</dependencyManagement>
工具:
<parent>
<groupId>com.somecompany</groupId>
<artifactId>x-parent</artifactId>
<version>1.0</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>com.somecompany</groupId>
<artifactId>tool</artifactId>
<packaging>jar</packaging>
<version>3.2.3</version>
官能測試:
<parent>
<groupId>com.somecompany</groupId>
<artifactId>x-parent</artifactId>
<version>1.0</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>functional-tests</groupId>
<artifactId>functional-tests</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>com.somecompany</groupId>
<artifactId>tool</artifactId>
</dependency>
</dependencies>
你可以給你不同模塊的poms片段......(只有模塊的父母部分和模塊部分)。 – khmarbaise 2010-08-31 07:42:06