简体   繁体   中英

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

在此处输入图片说明

What i have done so far?

  • Right Click on Projec --> Maven -->update project. it doesn't work
  • Run as maven install
  • Delete Project and got a fresh copy again. same issue was there
  • Set maven to out side maven folder
  • Deleted all maven settings. re installed.
  • Re installed fresh copy of eclipse and changed by workspace

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

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.

try

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM