Maven基础:错误对应:was cached in the local repository

当Maven编译时遇到'was cached in the local repository'错误,通常是由于指定的'springfox-swagger-ui'版本不存在于中央仓库。解决方法包括:修改回正确版本、删除本地缓存目录或完全清理.M2仓库后再执行编译。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

这篇文章记录一下Maven一个简单错误的原因和对应方法

文章目录


现象

编译的时候提示如下错误信息:

[ERROR] Failed to execute goal on project Spring-boot-activiti: Could not resolve dependencies for project xxxxxx-xxxxxx:Spring-boot-activiti:jar:1.1: Failure to find io.springfox:springfox-swagger-ui:jar:2.3.2 in 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 -> [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
liumiaocn:devops-approval liumiao$

原因

因为错误将springfox-swagger-ui的版本写成2.3.2,导致的错误,看一下Central仓库就可以看到没有这个版本
在这里插入图片描述


对应

  • 方法1: 改回来再次mvn clean package即可。
  • 方法2: 如果继续出错,考虑删除springfox-swagger-ui的目录,重新mvn clean package
  • 方法3: 再出错的话,把.m2下的repository整个删除,重新mvn clean package
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值