0

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)

Community
  • 1
  • 1
user3831696
  • 87
  • 1
  • 6
  • Have you tried rebuilding with -U flag? – JamesB Jul 12 '14 at 13:19
  • try right click on your project -> Team -> Maven -> Update (force) – alex Jul 12 '14 at 13:26
  • 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 Jul 12 '14 at 13:37

2 Answers2

0

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

mvn dependency:purge-local-repository
Stefan
  • 12,108
  • 5
  • 47
  • 66
  • Can you please let me know how I can clean the local repository? I am new to STC and Maven and hence this basic question. – user3831696 Jul 12 '14 at 13:40
0

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.

user3831696
  • 87
  • 1
  • 6