Bruce
Bruce

Reputation: 8849

Maven pom.xml file shows error

i cloned a maven project from git hub. But in the pom file it shows error.git hub project don't have any errors. Because it is working perfectly in another machine.And i'm not behind any proxy servers. I tried most of the sollutions in the stackoverflow. But i could not overcome from that issue.

ERROR

Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.10 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. Original error: Could not transfer 
 artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.10 from/to central (http://
 repo.maven.apache.org/maven2): null to http://repo.maven.apache.org/maven2/org/apache/maven/
 plugins/maven-surefire-plugin/2.10/maven-surefire-plugin-2.10.pom

enter image description here

What i have done so far?

Nothing works for me. Plz help me.....

Upvotes: 1

Views: 11926

Answers (3)

Shoban Sundar
Shoban Sundar

Reputation: 573

Try disabling Maven nature and again enable Maven.

  1. Right click the project => Maven => Disable Maven Nature
  2. Right click the project => Configure => Convert to Maven Project

Try is this works.

Upvotes: 0

Pablo L. Costa
Pablo L. Costa

Reputation: 1

try

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

Upvotes: 0

OhadR
OhadR

Reputation: 8839

Go to your local repo (usually it is under .m2), and search for org/apache/maven/plugins/maven-surefire-plugin directory. You will find there a "placeholder" - try to delete this directory and try to re-build.

Then, I suggest to build the project from command-line, and not from any other tool such as eclipse, because all IDEs may faces issues, so first let's make sure the project compiles successfuly from command line, and only then we will try to solve IDEs issues.

In addition, @ben is correct - you can run mvn -U clean install to force maven to download a fresh copy.

Upvotes: 1

Related Questions