[英]maven 3 Failed to read artifact descriptor for
我升級到使用嵌入式maven 3的netbeans 7.我有一個包含許多模塊和包含其他模塊的模塊的項目。 我的其他子模塊不依賴於內部項目,可以使用相同的配置。 在這種情況下,spring-hibernate依賴於作為子模塊之一的域而失敗。
我的主要項目有這樣的東西
<modelVersion>4.0.0</modelVersion>
<artifactId>spring</artifactId>
<packaging>pom</packaging>
<groupId>${masterproject.groupId}</groupId>
<version>${masterproject.version}</version>
我的子模塊有以下def
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>spring</artifactId>
<groupId>${masterproject.groupId}</groupId>
<version>${masterproject.version}</version>
</parent>
<artifactId>spring-hibernate</artifactId>
<packaging>pom</packaging>
<dependency>
<groupId>${masterproject.groupId}</groupId>
<artifactId>domain</artifactId>
</dependency>
我正在使用以下$ {masterproject.groupId},$ {masterproject.version},因為我不想在所有子模塊中放置靜態值,因為每個子模塊都包含父項。 不確定這是否是問題的原因。
所有這一切都適用於maven 2.但是使用maven 3我得到以下錯誤信息
Failed to read artifact descriptor for com.merc:domain:jar:1.0-SNAPSHOT: Failure to find ${masterproject.groupId}:MavenMasterProject:pom:${masterproject.version} in http://repository.springsource.com/maven/bundles/release was cached in the local repository, resolution will not be reattempted until the update interval of com.springsource.repository.bundles.release has elapsed or updates are forced -> [Help 1]
我在eclipse中有這個並做了這個修復它(即使我的命令行構建工作)
mvn命令行工作,而我的IDE沒有,一旦我在我的IDE中運行它都工作..非常奇怪。
作為另一種選擇,重啟eclipse似乎也有幫助
該消息,尤其是Failure to find
部分的消息,意味着您缺少pom.xml
文件中相應屬性的描述:
<properties>
<masterproject.version>the.appropriate.version</masterproject.version>
</properties>
並且要小心:這樣的錯誤可能會引發許多依賴錯誤!
我有同樣的問題,maven不喜歡有一個非常量(即屬性)父版本。
嘗試將您的父元素更改為:
<parent>
<artifactId>spring</artifactId>
<groupId>${masterproject.groupId}</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
顯然,它不必是1.0-SNAPSHOT
它只需要一些靜態版本。
希望這可以幫助。
一種可能性是您在profiles.xml
中指定masterproject.groupId
和masterproject.version
的值。 如果是這樣,maven3 不再支持它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.