pom.xml文件錯誤
剛創建的maven項目,馬上pom.xml的第一行就報錯
這是第一行:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
錯誤信息:
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
pom.xml /sypro line 1
Maven Configuration Problem
報錯錯誤信息大概意思是說maven想要嘗試去下載maven-surefire-plugin,但是又無法下載。
解決方法:
-
首先確定你的電腦是否可以連接網絡。
-
如果可以連接網絡,在maven的本地庫的路徑下執行以下命令:
for
/r
%i
in
(*.lastUpdated)
do
del %i
- 最後,嘗試刷新maven工程,看是否可以成功。
pom.xml文件錯誤