34

ERROR:

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

Solutions Tried:

Updated project: not able to download from REPO of maven.

Tried putting perticular jar in that folder of .m2 repo.

Can provide references if you want.

spt025
  • 2,134
  • 2
  • 20
  • 26

17 Answers17

39

Seems your settings.xml file is missing your .m2 (local maven repo) folder.

When using eclipse navigate to Window -> Preferences -> Maven -> User Settings -> Browse to your settings.xml and click apply.

Then do maven Update Project.

enter image description here

Kalyan Chavali
  • 1,330
  • 8
  • 24
17

Right Click on Project go to -> Maven -> Update project ->select Force update project check box and click on Finish.

Vinayak
  • 439
  • 4
  • 10
8

I have faced the same issue. Try declaring missing plugin in the conf/settings.xml.

<build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.6</version>
        </plugin>           
      </plugins>
    </pluginManagement>   
</build>
Pardeep
  • 945
  • 10
  • 18
7

On windows:

  1. Remove folder from C:\Users\USER.m2
  2. Close and open the project or force a change on file: pom.xml for saving :)
Douglas Tondo
  • 81
  • 1
  • 2
  • I wanted to use this instead of opening project in eclipse, but unfortunately didn't work for me – dko Apr 05 '21 at 17:32
6

If a download fails for some reason Maven will not try to download it within a certain time frame (it leaves a file with a timestamp).

To fix this you can either

  • Clear (parts of) your .m2 repo
  • Run maven with -U to force an update
Pim Verkerk
  • 1,066
  • 7
  • 12
4

Step 1 : Check the proxy configured in eclipse is correct or not ? (Window->Preferences->General->Network Connections).

Step 2 : Right Click on Project-> Go to Maven -> Update the project

Step 3: Run as Maven Install.

==== By Following these steps, i am able to solve this error.

Shubham Verma
  • 997
  • 1
  • 10
  • 13
1

This fixed the same issue for me: My eclipse is installed in /usr/local/bin/eclipse

1) Changed permission for eclipse from root to owner: sudo chown -R $USER eclipse

2) Right click on project/Maven right click on Update Maven select Force update maven project

mlapaglia
  • 852
  • 14
  • 31
bartleonid
  • 11
  • 1
1

I had exactly the same error. My network is an internal one of a company. The proxy has been disabled from the IT team so for that we do not have to enable any proxy settings. I have commented the proxy setting in settings.xml file from the below mentioned locations C:\Users\vijay.singh.m2\settings.xml This fixed the same issue for me

1
This 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>
SKSajjan
  • 101
  • 1
  • 2
0

I had exactly the same error. My network is an internal one of a company. I downloaded neon-eclipse for java developpers. These steps worked for me:

1- I downloaded a VPN client on my PC to be totally blinded from the network. Shellfire I used. Use free account and connect to Shellserver.

2- Inside the windows firewall, I added incoming rule for Eclipse. Navigate to where eclipse exe is found.

3- Perform Maven Update project.

Then the project was able to fetch from the maven repository.

hope it helps.

halim
  • 386
  • 4
  • 14
0

Tried everything. I deleted m2e and installed m2e version 2.7.0. Then deleted the .m2 directory and force updated maven. It worked!

0

Right click on your project under Package Explorer > Maven > Update Project > Select the checkbox that reads "Force updates of Snapshot/Releases" > Click on OK

This way you don't have to search around for your maven's settings.xml and if the cause is something else eclipse will automatically handle it whatever it may be. Expected path for user settings XML is shown by eclipse under: Window > Preferences > Maven > User Settings > User Settings (it is most likely, greyed out).

0

What worked for me was:

mvn -Dhttps.protocols=TLSv1.2 install

  • 2
    Would you like to explain how that works and why it helps to solve the problem? Or are you just confirming (part of) one of the other existing answers? – Yunnosch Mar 23 '22 at 12:02
0

I faced the same issue and resolved by deleting the project that i created and then deleted the M2 folder in the local.

benson
  • 1
  • 1
  • 1
    improve your answer with more details about the solution. The project you deleted were the one with the issue or another that caused it? After deleting, what were the next steps: you recreated the project? you just build it again? The current state of the answer is not enough to solve the problem! With more details is easier to understand! – Felipe Bonfante May 19 '22 at 12:22
0

I got similar issue and resolved by updating below

  1. Java version
  2. download and set up latest maven version
  3. double check the mvn and java class path in environments variable
  4. Run the mvn commands as Admin on console.
  5. take backup of existing m2 repository and created new .m folder

Hope it helps

RahulG
  • 1
  • 1
0

If you are using jenkins and Sonatype Nexus repository :

  1. Update pom.xml :

     <build>
     <plugins>
         <plugin>
             <artifactId>maven-resources-plugin</artifactId>
             <version>3.3.1</version>
         </plugin>
     </plugins>
    

  1. Update the Maven version in Jenkins --> Manage Jenkins --> Tools : Maven verion 3.2.5

  2. Login to Jenkins server and remove .m2 folder ( /jenkins/.m2/)


  1. Login to Sonatype and check whether Proxy URL is http or https. Use these URLs only for Maven Proxy : https://repo.maven.apache.org/maven2/ -- OR--
    https://repo1.maven.org/maven2/
quazi
  • 1
  • 2
-1

If you're connected to VPN, disconnect and then try.

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 17 '22 at 09:33