Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.18.1
阿新 • • 發佈:2019-01-22
問題描述
eclipse 匯入一個 Maven 工程時,pom.xml 檔案第一行的XML文件宣告處報錯,紅叉處提示如下錯誤:
Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.18.1 from
https://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-compiler-plugin:pom:2.18.1 from/to central (https://repo.maven.apache.org/maven2):
connect timed out pom.xml /pay-core-baixin-api line 1 Maven Configuration Problem
問題原因
從錯誤提示看到,maven-compiler-plugin:pom:2.18.1 從maven網上下載失敗是由於本地倉庫已經有該外掛的快取了,搜尋了該檔案後才知道在另一個本地倉庫路徑下有快取該外掛。
解決方法
1、首先刪掉另一個本地倉庫已快取的 ~.m2\repository\org\apache\maven\plugins\maven-surefire-plugin\2.18.1 目錄;
2、然後通過 maven->update projects,勾上 force update of snapshots/releases ,更新工程即可。
所以本地的maven倉庫最好只設置一個。