米德

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

碰到了好几次,刚导入的项目,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  米德  阅读(2040)  评论(0编辑  收藏  举报