解决maven cached in the local repository问题

在执行maven clean package时遇到如下错误提示: Could not resolve dependencies for project org.springframework.boot:XXXX:jar:2.0-SNAPSHOT: Failed to collect dependencies at com.XXXX:XXXX:jar:2.0-SNAPSHOT: Failed ...
摘要由CSDN通过智能技术生成

在执行maven clean package时遇到如下错误提示:

 Could not resolve dependencies for project org.springframework.boot:XXXX:jar:2.0-SNAPSHOT: Failed to collect dependencies at com.XXXX:XXXX:jar:2.0-SNAPSHOT: Failed to read artifact descriptor for com.XXXX:XXXX:jar:2.0-SNAPSHOT: Failure to find com.XXXX:XXXX:pom:2.0-SNAPSHOT in http://XXXX:XXXX/repository/maven-snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of maven-snapshots has elapsed or updates are forced -> [Help 1]

【问题原因】:由缓存导致

Maven默认会使用本地缓存的库来编译工程,对于上次下载失败的库,maven会在~/.m2/repository/<group>/<artifact>/<version>/目录下创建xxx.lastUpdated文件,一旦这个文件存在,那么在直到下一次nexus更新之前都不会更新这个依赖库。

解决办法】:删除缓存或者强制每次都更新依赖库

1. 删除缓存

删除v~/.m2/reposit

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值