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?
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
My answer is based on the previous one (didn't work with the settings.xml for me)
- I deleted everything under ...\Users\myUser.m2\repository*
Added in pom.xml the following dependency:
dependency>
groupId>org.apache.maven.plugins
artifactId>maven-resources-plugin
version>2.5
Modified all '_remote.repositories' files under '.m2\repository\org\apache\maven\plugins' and set the '.jar>central=http://mirrors.ibiblio.org/pub/mirrors/maven2'
cleann
install
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.
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.