Maven构建报错:was cached in the local repository, resolution will not be reattempted until the update in

构建时报错信息如下:

在这里插入代码片

> [ERROR] Failed to execute goal on project vfactory: Could not resolve dependencies 
> for project com.nan:vfactory:jar:1.0.0: Failure to find javax.annotation:javax.annotation-
> api:jar:1.3.2 in http://maven.aliyun.com/nexus/content/groups/public/ was cached in the 
> local repository, resolution will not be reattempted until the update interval of alimaven 
> has elapsed or updates are forced -> [Help 1]

并且无论怎么更改代码都不能解决,着实给人气死,特记此以诫之

问题原因 :

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

我的解决方案,在 ~/.m2/repository目录下找到maven缓存的包,并且删掉,重新构建即可

无论是Windows还是Linux,只需要删掉maven缓存仓库下对应的包并删掉即可,一般都是在.m2目录中,具体位置可以自行搜索

其他方案:https://blog.51cto.com/qiangsh/1743074

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值