简体   繁体   中英

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

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM