1. 程式人生 > >maven項目pom.xml第一行報錯

maven項目pom.xml第一行報錯

maven項目 att ted fontsize pid ble 原因 con 路徑

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

解決方法:

1.首先確定已經連網

2.報錯信息意思是說maven想要嘗試去下載maven-surefire-plugin,但是又無法下載。

項目使用maven管理jar包,很容易因為各種原因(網速慢、斷網)導致jar包下載不下來,出現很多.lastUpdated文件。 需要將其全部刪除,

打開cmd,maven本地庫的路徑下執行for /r

%i in (*.lastUpdated) do del %i

技術分享圖片

3.然後右鍵maven工程,maven->update 刷新一下,重新下載。

maven項目pom.xml第一行報錯