pom.xml報錯,jar包導入出錯,解決辦法之一


碰到了好幾次,剛導入的項目,pom.xml無法導入

依賴全部報紅

重新導入多次,都是一樣的結果

類似這樣的報錯:

Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.0.3.RELEASE 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.springframework.boot:spring-boot-starter-parent:pom:2.0.3.RELEASE from/to central (
https://repo.maven.apache.org/maven2): Connection reset

通過網上查詢,發現可能是因為各種原因(網速慢、斷網)導致jar包下載不下來,出現很多.lastUpdated文件。

而這些文件依然會導致jar包下載出錯。

解決辦法:

在CMD中 

cd %userprofile%\.m2\repository
for /r %i in (*.lastUpdated) do del %i

刪除所有的.lastUpdated文件,重新導入項目即可。


免責聲明!

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



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