2
我在attaching tests guide和following question中描述的類似方式之間共享src /測試類。與Maven共享src /測試類,沒有版本規範的測試jar
所以,我有以下的pom.xml依賴關係:
<dependency>
<groupId>com.myco.app</groupId>
<artifactId>foo</artifactId>
</dependency>
<dependency>
<groupId>com.myco.app</groupId>
<artifactId>foo</artifactId>
<version>1.0.0-SNAPSHOT</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
但,在相反的問題上面,安裝與測試罐子的時候,我不希望指定具體測試 - 版本。在編譯級別的依賴關係:
<dependency>
<groupId>com.myco.app</groupId>
<artifactId>foo</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
在這種情況下,我的pom.xml與錯誤的消息關於缺少的版本。爲什麼會發生?爲什麼我可以指定依賴沒有版本但不是測試jar?有沒有辦法解決這個問題,並使測試罐使用它可以找到的最新的jar?
看看這個答案,看看是否符合您的需求:http://stackoverflow.com/questions/30571/how-do-i-tell-maven-to-use-the-latest-version-of- a-dependency –
這是一個多模塊構建? – khmarbaise
@khmarbaise,是的,這是一個多模塊構建。 – Stas