菜单 学习猿地 - LMONKEY

VIP

开通学习猿地VIP

尊享10项VIP特权 持续新增

知识通关挑战

打卡带练!告别无效练习

接私单赚外块

VIP优先接,累计金额超百万

学习猿地私房课免费学

大厂实战课仅对VIP开放

你的一对一导师

每月可免费咨询大牛30次

领取更多软件工程师实用特权

入驻
95
0

was cached in the local repository, resolution will not be reattempted until the update interval of fintech has elapsed or updates are forced

原创
05/13 14:22
阅读数 52003

今天使用命令mvn compile编译maven项目时提示错误信息,错误信息如下: 

[ERROR] Failed to execute goal on project <project_name>: Could not resolve dependencies
for project com.xxx.xxx:<project_name>:jar:1.0.7: Failure to find com.xxx.xxx:obj-test-client:jar:1.1.1
in http://maven-nexus.xxx.com/repository/maven-public/ was cached in the local repository, resolution 
will not be reattempted until the update interval of fintech has elapsed or updates are forced -> [Help 1]

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

解决办法:

删除v~/.m2/repository/<group>/<artifact>/<version>/目录下的*.lastUpdated文件,然后再次运行mvn compile编译工程。

Jenkins构建时报错:

通过jenkins编译时报此错,我的maven安装目录/opt/maven ,解决方法如下:

发现obj-test-client-1.1.1.jar下载到本地时失败,从提示可知是本地仓库的缓存(cached)造成,于是我删除目录/opt/maven/repo/<group>/obj-test-client/1.1.1后Jenkins重新构建(或在项目目录 mvn 重新编译)即可编译成功! 

注意你要确定远程仓库中存在此jar(obj-test-client-1.1.1.jar)包 

发表评论

0/200
95 点赞
0 评论
收藏