开发者

Could not calculate build plan :artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 is not available in the local repository

I have a spring maven 2 project. I built it in terminal and everything is ok, I got build success, but when trying to import it to eclipse I got this error:

Could not calculate build plan: The repository system is offline but the artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 is not available in the local repository.

although I am getting build success in开发者_运维问答 terminal and projects run fine. I made maven offline in eclipse, and disabled download index on startup any ideas why I am getting this error?


If you want to use maven from your local installation instead of the embedded version that comes with m2e, You have to do this

  • Windows ==> Preferences ==> Maven ==> Installations ==> Click Add (select your local maven installation directory)


If your pom is not specific as to the version of the maven-resources-plugin, that version will come from the superpom. By default, m2e uses an embedded copy of Maven 3.0.x. If the superpom there points to 2.4.3 and your 'outside-of-Eclipse' version asks for something else, then the Maven inside of Eclipse will go looking for 2.4.3 and fail due to the 'offline'.

Fix by configuring m2e to use the Maven installation you are using outside, or turning off 'offline' for one build.


Just right click on the project in eclipse and in the maven option select update maven project and dont forget to check force update check box and finally hit on ok. It worked for me.


add below line to your pom.xml and build it through command line using ‘mvn install’. That will download the plugin and then try to build from Eclipse. make sure your Eclipse is using the same Maven not the embeded one. If you are still having issues, delete it from local repository and try again. The line to add is

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
</plugin>
</plugins>
</build>

before doing that find where your local repo is, then go to "/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/", remove the contents and do "update dependencies" from Maven.


Try Right clicking on POM.xml --> maven --> update project.


The solution is very simple, It is of two steps:

  1. Open your pom.xml file, navigate to -> Run -> Run as -> maven install

  2. Right click on your spring Boot project navigate to maven -> update project

Hope This Works.


Right click on the project in eclipse and Select the maven option select update maven project and check for "force update...." check box and hit on ok. It's working.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜