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