org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Faile
Most people will tell you to check your proxy settings or delete and re-add artifacts, 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
JackDev's option 3 works for me after I changed the default repository to another folder.
Below is what I see after M2E plugin automatically download the maven-resources-plugin-2.6. Maybe this could give you some hint if you want to take the manual approach. The necessary files can be downloaded from here: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/
My problem was the location of the config file.
In eclipse settings (Windows->preferences->maven->User Settings) the default config file for maven points to C:\users\*yourUser*\.m2\settings.xml
. If you unzip maven and install it in a folder of your choice the file will be inside *yourMavenInstallDir*/conf/
, thus probably not where eclipse thinks (mine was not). If this is the case maven won't load correctly. You just need to set the "User Settings" path to point to the right file.
In addition to what @JackDev replies, what also solved my problem was to
1) Install the jdk under directory with no spaces:
C:/Java
Instead of
C:/Program Files/Java
This is a known issue in Windows. I fixed JAVA_HOME
as well
2) Install maven as in Java case, under C:/Maven
. Fixed the M2_HOME
accordingly.
3) I java 7 and java 8 on my laptop. So I defined the jvm using eclipse.ini
. This is not a mandatory step if you don't have -vm
entry in your eclipse.ini
. I updated:
C:/Java/jdk1.7.0_79/jre/bin/javaw.exe
Instead of:
C:/Java/jdk1.7.0_79/bin/javaw.exe
Good luck
It appears that there can be a lot of different causes for this issue. I experienced it after installing a new version of Eclipse (Luna). Command-line maven worked fine, but Eclipse had build issues.
I use a Certificate Authority in my JRE. This is important because this provides my authentication when downloading Maven resources. Even though my project was pointing to the appropriate JRE inside of Eclipse - Eclipse was running using a different JRE (this is apparent looking at the Java process properties in Windows task manager). My solution was to add the following in my eclipse.ini and explicitly define the JRE I want to use.
-vm
C:\Program Files\Java\jdk1.7.0_51\bin\javaw.exe
Hopefully I'm not late for the party.
Encountered this using Eclipse Kepler and Maven 3.1.
The solution is to use a JDK and not a JRE for your Eclipse project. Make sure to try maven clean and test from eclipse just to download missing jars.