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 1411
抹茶落季
抹茶落季 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:16

    I also faced the above error. I used Eclipse.

    After followed the below solution, it works fine for me.

    Solution is,

    1. Right click project "pom.xml" in eclipse and select Maven Install.
    2. Right click on the project -> Maven -> Update Project.
    3. Refresh
    0 讨论(0)
  • 2020-12-08 08:17

    Mainly this occurs during Eclipse upgrade.
    I Solved using:

    -> Right Click Project-> Maven->Update Project-> Select all (checkbox)

    Old or out-dated, projects got refreshed with the updated jar files, and the required plugins. No more errors were visible.

    0 讨论(0)
  • 2020-12-08 08:19
    I had same issue while creating new spring project in eclipse using Maven.
    
    The main reason for this issue is that the proxy settings was not there.
    
    I used the following approach to reslove it:
    1) create settings.xml with  the below content
        <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">
          <localRepository/>
          <interactiveMode/>
          <usePluginRegistry/>
          <offline/>
          <pluginGroups/>
          <servers/>
          <mirrors/>
          <proxies>
            <proxy>
                <active>true</active>
                <protocol>http</protocol>
                <host>Your proxy</host>
                <port>Your port</port>
            </proxy>
          </proxies>
          <profiles/>
          <activeProfiles/>
        </settings>
    2) Save the settings.xml file under local C:\Users\<<your user account>>\.m2
    3) Then Right click project pom.XML in eclipse and select "Update Project". It always give precedence to settings.XML
    
    0 讨论(0)
  • 2020-12-08 08:20

    For me, this problem occurs in Eclipse when the Maven installation is not well configured. By default the Maven installation is embedded in Eclipse. The .settings.xml file is set wherever the Eclipse installation points.

    In my case this file was not auto-generated. I choose my own Maven installation - an external one. But if you don't explicitly choose where settings.xml is then Eclipse tries to get this file from the path set in the embedded installation. If the file is not autogenerated you have to choose the correct location.

    Go to windows/preferences/Maven/Installation/user settings and choose the correct location of your settings.xml.

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

    Right click project "pom.xml" in eclipse and select Maven Install. Right click on the Project -> Maven -> Update Project.

    Then Refresh.

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

    I have summarised what I did for my issue.

    1) Delete .m2 folder. 2) Change the apache-maven-3.5.4\conf\settings.xml as follow

    <proxies>
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxyserver.company.com</host> --> Please change it according to your proxy
      <port>8080</port> -->Please change it accordingly
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
    

    3) Try again in cmd. It will work.

    4) For eclipse, delete the existing maven project and go to

    window ->prefernces -> maven -> user settings -> browse -> configure this path apache-maven-3.5.4\conf\settings.xml
    

    5) Delete .m2 folder.

    6) Restart the eclipse and try creating new maven project.

    These steps worked for me.

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