1. 程式人生 > >maven中pom.xml首行報錯

maven中pom.xml首行報錯

錯誤異常:Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from http://maven.aliyun.com/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from/to nexus (http://maven.aliyun.com/nexus/content/groups/public): maven.aliyun.com

(說明:今天早上開啟eclipse後,就顯出這個錯誤,pom.xml上面有個小紅×,網上試了很多方法)

1.右擊pom.xml->Run As->Maven Clean

   pom.xml->Run As->Maven Install

(我用了,沒效果,但是你可以先試試) 

2.又嘗試:在c盤使用者裡C:\Users\...\.m2\repository\org\apache\maven\plugins,

(別人的方法:)發現沒有maven-surefire-plugin-2.**.*.jar這樣的檔案........(我發現我都不缺),->project->maven->update...

3.我的解決方案

  A.直接將C:\Users\...\.m2\repository\org\apache\maven\plugins\maven-surefire-plugin,整個資料夾刪除

  B.(Alt+F5)或者右擊專案->Maven->Update project

轉載自https://www.cnblogs.com/wx-ym-good/p/7349010.html