Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven 2- Could not calculate build plan

I set up Maven 2 on my laptop. The reason why I am still using Maven 2 is that Maven, somehow, doesn't work because of the proxy in my company.

The working environment: Eclipse Helio Service Release 2 Maven 2.2.1 Windows 7

The error message:

Errors occurred during the build.
Errors running builder 'Maven Project Builder' on project 'StrutsExample'.
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5

I thought it couldn't find the 2.5 jar so I downloaded it and added it into the local repository with the corresponding pom file manually, but it still can't work...

Any suggestion? Thanks in advance...

like image 830
user1888955 Avatar asked Sep 17 '13 13:09

user1888955


People also ask

What is the use of Maven war plugin?

The WAR Plugin is responsible for collecting all artifact dependencies, classes and resources of the web application and packaging them into a web application archive.

What is Maven resources plugin?

The Resources Plugin handles the copying of project resources to the output directory. There are two different kinds of resources: main resources and test resources.


2 Answers

My working solution:

  • Close Eclipse
  • Go to c:\Users\*yourUser*\.m2\repository directory
  • remove all the files called m2e-lastUpdated.properties present on all subdirectories
  • Restart eclipse, refresh and Update Maven Projects

My exact error was:

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-jar-plugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-jar-plugin:jar:2.4

Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-jar-plugin:pom:2.4 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced.

like image 55
melfore Avatar answered Sep 20 '22 04:09

melfore


Steps to resolve build plan:

  1. Close eclipse
  2. Delete all folders from .m2 repo
  3. Start the eclipse
  4. keep net connected and let maven update all dependencies
like image 30
Ramnath Avatar answered Sep 22 '22 04:09

Ramnath