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

tech2023-07-28  103

这篇文章记录一下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 淼叔 认证博客专家 神经网络 TensorFlow NLP 资深架构师,PMP、OCP、CSM、HPE University讲师,EXIN DevOps Professional与DevOps Master认证讲师,曾担任HPE GD China DevOps & Agile Leader,帮助企业级客户提供DevOps咨询培训以及实施指导。熟悉通信和金融领域,有超过十年金融外汇行业的架构设计、开发、维护经验,在十几年的IT从业生涯中拥有了软件开发设计领域接近全生命周期的经验和知识积累,著有企业级DevOps技术与工具实战。
最新回复(0)