【BUG记录】解决Failure to find (pom/jar) in http://xxx.com was cached in the local repository

【BUG记录】解决Failure to find (pom/jar) in http://xxx.com was cached in the local repository

☠注意:此解决方法仅针对作者在开发过程中遇到且解决的问题,不具有普遍性,仅供参考。

问题描述:在运行项目或maven install / deploy 过程中遇到报错:Failure to find (pom/jar) in http://xxx.com was cached in the local repository

解决步骤:

  1. 根据错误描述,进入本地仓库(repository)尝试寻找是否存在对应的jar包或pom文件。若存在剪切出到任意位置,在剪切后的路径下打开cmd窗口。
    【BUG记录】解决Failure to find (pom/jar) in http://xxx.com was cached in the local repository
    【BUG记录】解决Failure to find (pom/jar) in http://xxx.com was cached in the local repository

  2. 在cmd窗口中执行maven install命令。
    mvn install:install-file -DgroupId=com.aliyun.oss -DartifactId=aliyun-sdk-oss -Dversion=3.4.2 -Dpackaging=pom -Dfile=aliyun-sdk-oss-3.4.2.jar
    -DgroupId、-DartifactId、-Dversion对应pom.xml中的dependency。
    -Dpackaging为文件的类型jar或pom等等,-Dfile为文件名。

  3. 完成后回车执行。出现BuildSuccess即为构建成功。若出现BuildFailed,检查拼写是否正确。
    【BUG记录】解决Failure to find (pom/jar) in http://xxx.com was cached in the local repository
    有时会有依赖关联的情况,按照错误提示重复步骤尝试解决即可!