0
votes

I am getting the below error when I am trying to compile a Spring MVC project in STC. Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 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-surefire-plugin:pom:2.7.1 from/to central xxxx: Connect times out

I can access the Maven repository URL directly from my web browser, and it says Directory listing is not allowed. So I am not behind any web proxy. I just wanted to know if any port settings have to be made. Is STC trying to download the maven files using a non-standard port? Because then I have an anti-virus software which may be blocking accesses on this non-standard port.

I have already tried out options suggested as answer for question Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 from/to central (http://repo1.maven.org/maven2)

2
Have you tried rebuilding with -U flag? - JamesB
try right click on your project -> Team -> Maven -> Update (force) - dieter
How can I rebuild maven using -U flag? Is there a command which I need to issue from the command prompt? I did not find a Maven sub-menu under team. How ever I see the option Maven->Update project. I tried this option by disabling "Offline" option and enabling Force Update, Refresh workspace from local file system & Clean projects. None worked :( - user3831696

2 Answers

0
votes

The download failed once. Just clean your local repository cache and retry:

mvn dependency:purge-local-repository
0
votes

Phew.. On STC I right clicked on my Project Name-->Run As menu. In that I found lots of menu items having a small m2 icon next to them. One of them was 9 Maven Install. I clicked on that and it started building my project. It started lots of stuff from the repositories and came up with the below status report esults :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28.781s
[INFO] Finished at: Mon Jul 14 20:52:10 IST 2014
[INFO] Final Memory: 6M/96M
[INFO] ------------------------------------------------------------------------

And voila, the error message on pom.xml is gone!! Looks like an explicit instruction to Install did the trick.