was cached in the local repository 问题解决(maven)

今天在编译maven时报错:

[ERROR] Failed to execute goal on project logistics-service-api: Could not resolve dependencies for project com.baturu.logistics:logistics-service-api:jar:1.1.6_packageStatusFlow-SNAPSHOT: Failure
to find com....:logistics-service-api:jar:1.1.6_packageStatusFlow-SNAPSHOT in http://.../nexus/content/groups/public was cached in the local repository, resolution will
not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :logistics-service-api

问题原因:

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

解决办法:

网上的解决办法是:删除~/.m2/repository/ / / /目录下的*.lastUpdated文件,然后再次运行mvn clean install 编译工程。
可我试了,再次编译后~/.m2/repository/ / / /目录下又会有新的的*.lastUpdated文件

我想是这个文件导致了不能把本地的版本上传到私服,于是尝试把文件的后缀.lastUpdated去掉,使其变成一个jar文件
在这里插入图片描述
再次编绎项目,成功了,感动。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值