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

前端 未结 21 1414
抹茶落季
抹茶落季 2020-12-08 08:15

I got the following error message when I tried to create a Maven project in eclipse. Many have posted about proxies in settings.xml file and also flush the .m2 folder forcin

相关标签:
21条回答
  • 2020-12-08 08:26

    Maybe your network is slow, so that jar isn't downloaded completely.

    There are two methods:

    a. find your .m2 folder, you can find some path like this 'org/apache/maven/plugins/maven-resources-plugin', you need only delete this foldler 'maven-resources-plugin', because others are downloaded well.

    Then maven build your project.

    If other problem occures, repeat this process again.

    b. you can change a more quick maven source.

    Firstly, you should find maven's settings file(window ->prefernces -> maven -> user settings). If it is empty, you can create a new one (any path, for example, .m2/settings).

    Secondly, add sth like this (From https://blog.csdn.net/liangyihuai/article/details/57406870). This example uses aliyun's maven.

    <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
                              https://maven.apache.org/xsd/settings-1.0.0.xsd">
    
          <mirrors>
            <mirror>  
                <id>alimaven</id>  
                <name>aliyun maven</name>  
                <url>http://maven.aliyun.com/nexus/content/groups/public/</url>  
                <mirrorOf>central</mirrorOf>          
            </mirror>  
          </mirrors>
    </settings>
    

    Thirdly, maven build again. (before this, you should delete your .m2 folder's files)

    0 讨论(0)
  • 2020-12-08 08:30

    I also faced same problem... I follow the following steps...u can try it 1. Right click on maven project 2. Take cursor in Maven 3. Click on Update Maven project or (alt+F5). it will take some time then most probably problem will solved..

    0 讨论(0)
  • 2020-12-08 08:39

    I was able to solve the same problem with different solution.

    The solution that worked for me was to Right click project "pom.xml" in eclipse and select "Maven Install".

    0 讨论(0)
  • 2020-12-08 08:39

    Jotting down some steps which help:

    Writing answer from eclipse perspective as base logic will remain the same whether done by Intellij or command line

    1. Rt click your project -> Maven -> Update project -> Select Force update -> Click OK
    2. Under properties tag , add :
    >  <maven.compiler.source>1.8</maven.compiler.source> 
    > <maven.compiler.target>1.8</maven.compiler.target>
    
    1. In some instance , you will start seeing error as we tried force update , saying , failure to transfer X dependency from Y path , resolutions will not be reattempted , bla bla bla **In such case quickly fix it by cd to .m2/repository folder and run following command :

    for /r %i in (*.lastUpdated) do del %i**

    0 讨论(0)
  • 2020-12-08 08:40

    I have had this issue, and removing the .m2/repository/ has not solved it in my case. Seems that eclipse is unable to download the maven-plugin or dependency needed. Therefore you need to install it yourself.

    I have finally solved it downloading both jar and pom files from the Maven Repository and installing it using the command (better than copying to the folder directly): mvn install:install-file -Dfile=<path-to-file> -DpomFile=<path-to-pomfile> (In my case: mvn install:install-file -Dfile=maven-war-plugin-2.2.pom -DpomFile=maven-war-plugin-2.2.pom)

    0 讨论(0)
  • 2020-12-08 08:41

    Try cleaning the local .m2/repository/ folder manually using rm -rf and then re build the project. Worked for me after trying every possible other alternative(reinstalling eclipse, pointing to the correct maven version in eclipse, proxy settings etc)

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