Failed to read artifact descriptor for maven-resources-plugin

僤鯓⒐⒋嵵緔 提交于 2020-02-24 08:45:26

问题


Stage:

I am trying to compile a Maven project in Eclipse (Spring Tool Suite, version: 3.2.0.RELEASE).

Each project compilations throws this:

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5

How can I solve it?


回答1:


Basically it's not able to connect and download the artifact which could be a couple different things. Most people will tell you to check your proxy settings, but I will stay away from that and give another suggestion in case that doesn't turn out to be your problem. It could be your mirror settings.

If you use maven at the office then there's a good chance maven is configured to look for your company's internal maven repository. If you're doing some work from home and you are not connected to the network this could be the problem. An obvious solution might be VPN to the office to get visibility to this repo. Another way around this is to add another mirror site to your /User/.m2/settings.xml file so if it fails to find it on your office network it will try public repo.

<mirror>
  <id>Central</id>
  <url>http://repo1.maven.org/maven2</url>
  <mirrorOf>central</mirrorOf>
  <!-- United States, St. Louis-->
</mirror>

For other maven repositories take a look here: http://docs.codehaus.org/display/MAVENUSER/Mirrors+Repositories




回答2:


My answer is based on the previous one (didn't work with the settings.xml for me)

  1. I deleted everything under ...\Users\myUser.m2\repository*
  2. Added in pom.xml the following dependency:

    dependency> groupId>org.apache.maven.plugins artifactId>maven-resources-plugin version>2.5

  3. Modified all '_remote.repositories' files under '.m2\repository\org\apache\maven\plugins' and set the '.jar>central=http://mirrors.ibiblio.org/pub/mirrors/maven2'

  4. cleann

  5. install




回答3:


You should also check if your IDE is using the default (or embedded) maven or an external one, I had an issue multiple times when I got timeouts, mostly because I didn't load the proper configuration.




回答4:


Please check this section in Maven settings.xml file:

<proxies>
        <proxy>
            <active>true</active>
            <protocol>http</protocol>
            <host>proxy</host>
            <port>8080</port>
        </proxy>
</proxies>

If you don't have a proxy delete this section and problem was resolved.



来源:https://stackoverflow.com/questions/16291157/failed-to-read-artifact-descriptor-for-maven-resources-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!