天天看點

Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1

maven項目pom.xml報錯:

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

原因是maven的plugin并未下載下傳到本地.

打開maven的本地庫.m2\repository\org\apache\maven\plugins\maven-surefire-plugin\2.7.1會發現:裡面隻有一個maven-surefire-plugin-2.7.1.pom.lastUpdated,而沒有maven-surefire-plugin-2.7.1.jar

解決方法: 

1.删除maven-surefire-plugin-2.7.1.pom.lastUpdated檔案

2.右鍵點選項目 -> Maven - Update Dependencies