"Failed to read artifact descriptor" when compiling maven-dependency-plugin:

23.5k views Asked by At

I need to make a change to the maven dependency plugin to satisfy unique requirements in my organization.

I've downloaded the sources from http://maven.apache.org/plugins/maven-dependency-plugin/download.cgi

When I look at its pom, I see that it defines a parent pom like this:

<parent>
    <artifactId>maven-plugins</artifactId>
    <groupId>org.apache.maven.plugins</groupId>
    <version>27</version>
    <relativePath>../maven-plugins/pom.xml</relativePath>
  </parent>

This leads me to the understanding that this project cannot be built independently, at least not the version I have.

When trying to run mvn clean install anyway I get the following error:

Couldn't download artifact: Failed to read artifact descriptor for org.apache.maven:maven-model:jar:2.0.9

The funny thing is that it actually does exist in my local .m2 repository.

Is it really the case that if I want to make a contribution or a change to a maven plugin I have to have the entire environment or is there a way to build it independently?

I am using maven 3.0.4 and Nexus.

2

There are 2 answers

0
wemu On BEST ANSWER

The parent pom can be found in maven central.

So it should be enough to simple remove the <relativePath> statement from the <parent>. Sometimes an empty <relativePath /> also helps to tell maven to resolve the pom from the repository and not try to find it via a relative path in the project.

If the parent is not in a maven repository you either place it there - or you would need to checkout the version control project on a higher level so the path actually matches the local structure.

0
kad Dembele On

I'm not getting any issue with the specified plugin when I try to build it.

The error you are getting is relative to maven-model plugin and if it exists in your .m2 directory, you should:

  1. check if the repository specified in your settings.xml is your personal .m2/repository directory
  2. if yes, just clean your maven cache and force the update of your snapshots