文章目录
- 业务场景
- 错误提示
- 分析过程
- 解决办法
业务场景
settings.xml
种配置了私服,但是有些依赖私服上没有,通过同事拷贝过来的。但是用maven
打包时报红了。
错误提示
Idea Maven错误:was cached in the local repository, resolution will not be reattempted until the update
was cached in the local repository, resolution will not be reattempted until the update interval of io.spring.repo.maven.release has elapsed or updates are forced
This failure was cached in the local repository and resolution is not reattempted until the update interval of repo183 has elapsed or updates are forced
[ERROR] Failed to execute goal on project XXX: Could not resolve dependencies for project com.vixtel.project:boce-subscriber:jar:2.1.0-20230908: com.vixtel.vaf:vaf-nacos-config-precheck:jar:2.4.0-20230801 was not found in http://36.134.39.183:4000/repository/maven-public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of repo183 has elapsed or updates are forced
分析过程
- 按照提示,查找本地
repository
中是否有缺失的jar
,但jar
都是有的,同事拷贝的都有jar
文件 - 参考几篇文章:maven依赖报红。解决本地有jar包,idea无法加载
_remote.repositories文件的作用
使用Maven管理项目时,明明本地仓库有对应的jar包,但还是报找不到
快速清理本地仓库的文件
解释:maven3.x版本从远程库下载依赖后,会生成对应的_remote.repositories
文件,标示该资源的来源。如果你有这个文件_remote.repositories
,那就不会访问本地了,会去远程上找。必须远程上有才行,否则就会报错。
而我们的私服是没有依赖的,直接拷贝到的本地。
解决办法
删除对应仓库中的_remote.repositories
文件
如果多可以使用快速清理本地仓库的文件