maven 3 Failed to read artifact descriptor for
I upgrade to netbeans 7 which uses embeded maven 3. I have a project with lot of modules and modules containing other modules. My other submodules that don't depend on internal projects work fine with the same configuration. In this case, spring-hibernate depends on domain which is one of the submodules and fails.
my main project has something like this
<modelVersion>4.0.0</modelVersion>
<artifactId>spring</artifactId>
<packaging>pom</packaging>
<groupId>${masterproject.groupId}</groupId>
<version>${masterproject.version}</version>
my submodule has the following 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>
I am using the following ${masterproject.groupId}, ${masterproject.version} because I don't want to put static value in all the submodules as each one contains a parent. Not sure if this is the cause of the problem.
All of this works fine with maven 2. But with maven 3 I get the following error msg
Failed to read artifact descriptor for com.merc:domain:jar:1.0-SNAPSHOT: Failure to find ${masterproject.groupId}:MavenMasterProject:pom:${masterproject.version} in htt开发者_开发百科p://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]
I had this in eclipse and did this which fixed it(even though my command line build worked)
- delete the directory in .m2/repostiory/....
- rerun update dependencies in my IDE
mvn command line worked while my IDE didn't, once I ran it in my IDE both worked..very weird.
As another option, restarting eclipse seemed to help as well
One possibility is you are specifying the values for masterproject.groupId
and masterproject.version
in profiles.xml
. If so, it is no longer supported in maven3.
That message, especially that Failure to find
part, means that you lack the description of the appropriate property in the pom.xml
file:
<properties>
<masterproject.version>the.appropriate.version</masterproject.version>
</properties>
And be careful: such error could evoke many dependent errors!
I had the same issue, maven does not like having a non-constant (i.e. a property) parent version.
Try changing your parent element to:
<parent>
<artifactId>spring</artifactId>
<groupId>${masterproject.groupId}</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
Obviously, it doesn't have to be 1.0-SNAPSHOT
it just has to be some static version.
Hope this helps.
精彩评论