score:164

Accepted answer

i had the exact same problem.

[error] 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: failure to find org.apache.maven.plugins:maven-resources-plugin:pom:2.5 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [help 1]
...

had maven 3.0.5, eclipse kepler with jboss dev studio 7 installed. computer sitting on internal network with proxy to the internet. here's what i did.

0. check the maven repositiory server is up

1. check proxy is set up and working

first i thought it was a proxy problem, i made sure that maven settings.xml contained the proxy settings (settings.xml can exist in two places one in maven_home. the other in %userprofile%.m2\ with the later having higher precedence):

<proxy>
  <id>optional</id>
  <active>true</active>
  <protocol>http</protocol>
  <username>optional-proxyuser</username>
  <password>optional-proxypass</password>
  <host>proxy.host.net</host>
  <port>80</port>
  <nonproxyhosts>local.net|some.host.com</nonproxyhosts>
</proxy>

and checked that the proxy is working by trying to telnet to it:

telnet [proxy] [port number]

2. check not eclipse issue

ran 'mvn compile' at command line level outside of eclipse - same issue.

if 'mvn compile' worked. but it doesn't work using the maven plugin in eclipse, see maven plugin not using eclipse's proxy settings

3. check not cache issue deleted all contents in my local maven repository. (default location: ~/.m2/repository) and then reran maven - same issue came up.

4. what worked for me

automatically download & install missing plugin: by declaring the missing plugin in the pom file build section for pluginmanagement maven will automatically retrieve the required plugin. in the pom file, add this code for the version of the plugin you require:

  <build>
        <pluginmanagement>
          <plugins>
            <plugin>
              <artifactid>maven-resources-plugin</artifactid>
              <version>2.7</version>
            </plugin>           
          </plugins>
        </pluginmanagement>   
    </build>

manually install missing plugin: i went to http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-resources-plugin/2.5 and downloaded maven-resources-plugin-2.5.jar and maven-resources-plugin-2.5.pom . copied it directly into the maven repository into the correct folder ( ~/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/2.5) and reran 'mvn compile'. this solved the problem.


edit1

following this i had another two problem with 'mvn install':

the pom for org.apache.maven.plugins:maven-surefire-plugin:jar:2.10 is missing, no dependency information available

the pom for org.apache.maven.plugins:maven-install-plugin:jar:2.3.1 is missing, no dependency information available

i approached this problem the same way as above, downloading from http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin/2.10 and http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-install-plugin/2.3.1

score:0

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/

enter image description here

score:0

if you have a proxy, you also have to clear socks in

window > preferences > network connections.

score:0

i was getting the same issue.

i just installed the m2e (maven2eclipse)plugin from below site:

http://www.eclipse.org/m2e/

eclipse>help>install new software>available software sites>add

name: m2e (any name is ok)
location:m2e - http://download.eclipse.org/technology/m2e/releases/

under install window> work with:

select this new location and add all the plugins that appear. eclipse restart and it was running properly with no previous errors.

score:0

if your working at a company, they may be preventing you from downloading outside software and installing it. you may need to install the plugins manually or repoint to an internal mirror repository.

score:0

try downloading a different version of maven. i had the same problem with maven 3.5.2 , i solved my problem just downloading maven 3.0.4

score:0

very old stuff.

got it solved fixing the localrepository in settings.xml. this file was copied from my other computer and the path of the .m2 repository wasn't the same.

<?xml version="1.0" encoding="utf-8"?>
<settings xmlns="http://maven.apache.org/settings/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"
  xsi:schemalocation="http://maven.apache.org/settings/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <localrepository>c:\users\foo\.m2</localrepository>

</settings>

score:0

i could solve the issue with the following steps

  1. install maven separately
    https://www.mkyong.com/maven/how-to-install-maven-in-windows/
  2. set the external maven installation in eclipse
    enter image description here


3. set the proxy in settings.xml in maven installation
(c:\path\apache-maven-3.6.0\conf)

<proxy>
 <id>optional</id>
 <active>true</active>
 <protocol>http</protocol>
 <username>optional-proxyuser</username>
 <password>optional-proxypass</password>
 <host>proxy.host.net</host>
 <port>80</port>
 <nonproxyhosts>local.net|some.host.com</nonproxyhosts>
</proxy>
  1. update the maven user settings enter image description here

  2. update maven project
    enter image description here

score:0

i have shifted my project to a different machine, copied all my maven libraries from old machine to new machine, did right click on my project >> maven >> update project. and then built my project. in addition to this, i have also done this one step which is shown in screenshot. and that's all it worked!!

go to window --> preferences --> maven --> user setting, make sure you have these settings..
enter image description here

also right click on your project --> properties --> maven, and make sure you have the path here to maven repository..
enter image description here

score:0

i am facing the same issue and none of above works, like by updating the mvn also same error, by building is also same, entered details in settings.xml though even same issue.

after that again i tried and did something different which did not did before and it works.

its simple, i clicked the force update while updating the mvn project. by right clicking on the pom file, there is option under maven, "update project" and it open up one popup to select update option. please make sure force update is checked, by default is unchecked. and bingo, that works like charm!

score:0

to solve this issue i tried below method : (i was working on eclipse ide)

  1. go to location : c:\user\local.m2\setting.xml
  2. open setting.xml file in any editor.
  3. comment the proxy setting like i did(see below setting.xml file).
  4. then go to eclipse & perform maven update from :right clicking on your solution folder(your project)->select maven->update project.
  5. hope it will work for you as like me.

<?xml version="1.0" encoding="utf-8"?>
<settings xmlns="http://maven.apache.org/settings/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"
          xsi:schemalocation="http://maven.apache.org/settings/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!--
    <proxies>
        <proxy>
            <id>optional</id>
            <active>true</active>
            <protocol>http</protocol>
            <username>proxyuser</username>
            <password>proxypass</password>
            <host>proxy.host.net</host>
            <port>80</port>
        <nonproxyhosts>local.net|some.host.com</nonproxyhosts>  
        </proxy>
    </proxies>
    -->
</settings>

score:0

i ran into this same problem with eclipse on ubuntu 18.04. i tried:

  1. setting up the settings.xml file with no result;
  2. forcing rebuild of the project, same error;
  3. working with the suggestion of @jackdev. but when i went to download each resource individually, i noticed that wget was failing because of a self-signed certificate at the https://repo1.maven.org. this gave a clue of the cause.

i temporarily turned off the virus defenses of the server and was able to build properly from inside of eclipse. i mention this here in case someone else is seeing the same restriction.

score:1

i had the same problem but with an other cause. the solution was to deactivate avira browser protection (in german browser-schutz). i took the solusion from m2e cannot transfer metadata from nexus, but maven command line can. it can be activated again ones maven has the needed plugin.

score:1

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

score:1

in my case i'm using an external maven installation with m2e. i've added my proxy settings to the external maven installation's settings.xml file. these settings haven't been used by m2e even after i've set the external maven installation as default maven installation.

to solve the problem i've configured the global maven settings file within eclipse to be the settings.xml file from my external maven installation.

now eclipse can download the required artifacts.

score:1

after entering your proxy settings in settings.xml

<proxies>
<!-- proxy 
 | specification for one proxy, to be used in connecting to the network.
 |  -->
<proxy>
  <id>optional</id>
  <active>true</active>
  <protocol>http</protocol>
  <username>domain\yourid</username>
  <password>123456</password>
  <host>proxy.company.com</host>
  <port>8080</port>
  <nonproxyhosts>local.net|some.host.com</nonproxyhosts>
</proxy>

</proxies>

check whether the below tag is having the value false in settings.xml

<offline>false</offline>

this helped me.

score:1

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

score:1

if you've configured a repository in your maven's settings.xml, check if you've access to it.

when i had this problem, there were enterprise repositories configured in settings.xml but i was out of the company.

score:2

a more subtle reason for this could be a settings.xml file which has a space in the first line before the doctype

score:2

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.

score:3

try to delete all dirs in /usr/share/maven-repo - of course then maven will die so you must re-install and try again. in my case re-install from maven ver.3. to maven2 with deleting all repositories helped.

i tried by deleting all from .m2 but that didn't help.

score:3

some files where missing at your local repository. usually under ${user.home}/.m2/repository/

neets answer solves the problem. however if you dont want do download all the dependencies to your local repository again you could add the missing dependency to a project of yours and compile it.

use the maven repository website to find the dependency. in your case http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-resources-plugin/2.5 was missing.

copy the listed xml to the pom.xml file of your project. in this case

<dependency>
    <groupid>org.apache.maven.plugins</groupid>
    <artifactid>maven-resources-plugin</artifactid>
    <version>2.5</version>
</dependency>

run mvn compile in the root folder of the pom.xml. maven will download all missing dependencies. after the download you can remove the added dependency.

now you should be able to import the maven project or update the project without the error.

score:3

what i found out is that while m2e is looking for v2.5 by default, my local repo has 2.6 and no 2.5.

without going into investigation of how this came about simply adding the dependency to pom solved the problem

<dependency>
    <groupid>org.apache.maven.plugins</groupid>
    <artifactid>maven-resources-plugin</artifactid>
    <version>2.6</version>
</dependency>

this can be removed after running a build once

score:3

his issue is happening due to change of protocol from http to https for central repository. please refer following link for more details. https://support.sonatype.com/hc/en-us/articles/360041287334-central-501-https-required 

in order to fix the problem, copy following into your pom.ml file. this will set the repository url to use https.

<repositories>
        <repository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>central</id>
            <name>central repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
        </repository>
    </repositories>
    <pluginrepositories>
        <pluginrepository>
            <releases>
                <updatepolicy>never</updatepolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>central</id>
            <name>central repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
        </pluginrepository>
    </pluginrepositories>

score:4

you should check force update snapshots/releases when updating project with maven.it worked for me :-). force update snapshots/releases

score:7

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.

score:7

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 

score:9

i faced the same issue while using eclipse kepler and maven version 3.2,

while building the project, it showed me the same error in eclipse

there are two versions (2.5 and 2.6) of plugin under

.m2/repository/org/apache/maven/plugins/maven-resources-plugin/

i removed 2.5 version then it worked for me

score:12

follow easy steps to resolved the below issue: 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 description for org.apache.maven.plugins:maven-ar-plugin:ar:2.4 in eclipse

enter image description here

solution: step1: enter image description here

step2:

enter image description here

issue solved

enter image description here

score:18

couple of things to try:

  1. doublecheck the location of the local artifact repo configured in your settings.xml file (at the following location {your home folder}/.m2/settings.xml). are you sure the local repo is where you think it is? (yes, a mistake i've made in the past...)
  2. remove entire contents of artifact repo on the new build machine (or at least anything related to maven). you mentioned doing some artifact repo cleanup but i'm not sure what directory(ies) you removed. i've run into weird issues like these when a jar was corrupted.
  3. make sure you have enough disk space/quota for the local artifact repo. i have run into weird issues when i didn't have a large enough quota to hold all the artifacts, likely caused by partially downloaded jar files.
  4. try running with plain maven on the command line; take eclipse and m2e out of the equation. mvn -u dependency:resolve should do it. the -u forces maven to download no matter what your repository update policies are. add -x to get detailed debug logging.
  5. copy settings.xml from maven_home\conf\ to user_home.m2. add proxies (if needed) in case you are behind a proxy server.

score:137

i had the exact same problem and since i read somewhere that the error was caused by a cached file, i fixed it by deleting all the files under the .m2 repository folder. the next time i built the project i had to download all the dependencies again but it was worth it - 0 errors!!


Related Query

More Query from same tag