解决 spring-boot-maven-plugin:2.0.3.RELEASE or one of its dependencies co

1,当我使用mvn clean install -D maven.test.skip=true命令执行spring boot项目时,报错如下

[ERROR] Plugin org.springframework.boot:spring-boot-maven-plugin:2.0.3.RELEASE or one of its dependencies could not be resolved: Failure to find org.springframework.boot:spring-boot-maven-plugin:jar:2.0.3.RELEASE in http://mvn.hz.netease.com/artifactory/repo 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]

2,原因:插件org.springframework.boot:spring-boot-maven-plugin:2.0.3.RELEASE或其中一个依赖项无法解析,找不到缓存在本地仓库中的org.springframework.boot:spring-boot-maven-plugin:jar:2.0.3.RELEASE,在中心的更新间隔过去或强制更新之前,不会再重新尝试解析。

本人之所以产生这种原因,也是因为本人使用的是公司的maven仓库,而公司仓库中并不存在这个依赖包

3,解决方法:

找到maven在本地的配置文件,.m2/settings.xml,将其备份为其它文件名,然后找其它同学复制一份非公司仓库的settings.xml配置文件过来,然后再重新执行mvn clean install即可

注意:在重新执行时,有时有些jar一直无法下载下来,有可能是因为你在几个项目中同时加载jar到新配置仓库中的原因,解决方法:将idea等上执行的maven加载状态停止甚至关闭idea,然后去对应jar要被加载的位置下删除"jar名+.lock文件”,最后重新执行mvn install即可

猜你喜欢

转载自blog.csdn.net/qq_2300688967/article/details/81217218
今日推荐