maven项目work offline时Failed to read artifact descriptor for XXX导入jar包失败

来源:https://hedleyproctor.com/2016/09/maven-offline-build-fails-to-resolve-artifacts-in-your-local-repository/

有个项目部署到内网时,使用拷贝过去的maven仓库经常会出现jar包导入失败的问题,报错信息为:

Failed to read artifact descriptor for XXX

根据这篇文章,maven在下载远程仓库的jar包是会生成一个_maven.repository文件(实际上我的maven仓库中是_remote.repository),然后导入时maven发现_maven.repository文件中声明的远程仓库地址不在settings.xml中,所以maven不使用这个jar包。

根据评论,将_maven.repository删除就可以导入了,尝试后确实导入成功。

猜你喜欢

转载自www.cnblogs.com/Nelofie/p/9208764.html