Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved

前端 未结 29 1210
执笔经年
执笔经年 2020-11-22 11:56
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         


        
相关标签:
29条回答
  • 2020-11-22 12:18

    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.

    0 讨论(0)
  • 2020-11-22 12:19

    You should check Force Update Snapshots/Releases when updating project with maven.It worked for me :-).

    0 讨论(0)
  • 2020-11-22 12:19

    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

    0 讨论(0)
  • 2020-11-22 12:20

    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


    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

    2. Update Maven project

    0 讨论(0)
  • 2020-11-22 12:22

    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.
    0 讨论(0)
  • 2020-11-22 12:23

    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.

    0 讨论(0)
提交回复
热议问题