maven項目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

 

解決方法:

1.首先確定已經連網

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

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

  打開cmd,maven本地庫的路徑下執行for /r %i in (*.lastUpdated) do del %i


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

 

   

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM