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 1413
抹茶落季
抹茶落季 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:23

    There could be multiple reasons, i fixed with following steps:

    1. delete .m2 folder and re launch eclipse. (Find m2 folder in windows: c:\Users\Your_User_Name\ .m2 or to search in Mac : ~/.m2
    2. make sure settings.xml is configured as #JustinBieber mentioned.
    3. provide settings.xml path in eclipse (windows->preferences->maven->user settings) User Settings must locate settings.xml file.

    save changes and relaunch the eclipse..!! it should work.

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

    run:

    mvn -U dependency:go-offline
    

    It works for me.

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

    I solved it now. However it only is solved in Netbeans. Not sure why eclipse still won't take the settings.xml that is changed. The solution is however to remove/comment the User/Password param in settings.xml

    Before:

    <proxies>
        <proxy>
          <id>optional</id>
          <active>true</active>
          <protocol>http</protocol>
          <username>proxyuser</username>
          <password>proxypass</password>
          <host>proxyserver.company.com</host>
          <port>8080</port>
          <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
        </proxy>
      </proxies> 
    

    After:

    <proxies>
        <proxy>
          <id>optional</id>
          <active>true</active>
          <protocol>http</protocol>
          <host>proxyserver.company.com</host>
          <port>8080</port>
          <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
        </proxy>
      </proxies> 
    
    0 讨论(0)
  • 2020-12-08 08:24

    I also had the same problem. I used next way:

    1.Added settings.xml file (~/.m2/settings.xml) with next content

    <proxies>
       <proxy>
          <active>true</active>
          <protocol>http</protocol>
          <host>qq-proxya</host>
          <port>8080</port>
          <username>user</username>
          <password>passw</password>
          <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
        </proxy>
      </proxies>
    

    3. Using cmd go to folder with my project and wrote mvn clean and after that mvn install !

    1. After that updated project in the Eclipse(Alt + F5) or right click on project -> Maven -> Update project

    P.S. after that, when I add new dependency to my project I have to compile project using cmd(mvn compile). Because if I do it using eclipse plugin, I get error connecting with proxy connection.

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

    Excellent i got solution:
    Just clearing (.m2) complete folder and starting a new maven project problem solved for me.

    Note:: .m2 folder located in os installed disk only.
    If you want the exact location, check in Eclipse:
    Eclipse-->window-->preferences-->maven-->user settings
    There local repository path is for .m2
    Delete entire .m2 folder and restart your eclipse.

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

    Whenever if you get this error please delete .m2 repository from local drive C:\Users\user and delete .m2 from there. The reason is this is existing repository used by different workspace so not allowing new application to create

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