pom.xml报错,jar包导入出错,解决办法之一

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文件,重新导入项目即可。

posted on 2018-11-26 13:54 米德 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/mide0131/p/10019919.html

你可能感兴趣的:(pom.xml报错,jar包导入出错,解决办法之一)