maven error “failure to transfer…”

I am trying to set up a project using Maven (m2eclipse), but I get this error in Eclipse:

1
Description Resource Path Location Type Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 from http://repo1.maven.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. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 from/to central (http://repo1.maven.org/maven2): No response received after 60000 ExampleProject Unknown Maven Problem



Remove all your failed downloads:

1
find ~/.m2  -name "*.lastUpdated" -exec grep -q "Could not transfer" {} ; -print -exec rm {} ;

For windows:

1
2
cd %userprofile%.m2repository
for /r %i in (*.lastUpdated) do del %i

Then rightclick on your project in eclipse and choose Maven->”Update Project …”, make sure “Update Dependencies” is checked in the resulting dialog and click OK.

参考文献

https://stackoverflow.com/questions/5074063/maven-error-failure-to-transfer