maven -U clean install 出现错误

项目配置的maven仓库镜像时阿里云的,然后配置了本地仓库路径。
项目依赖了一个第三方jar,然后jar已经安装到了本地仓库

项目启动没有问题,但是打包的时候出现了错误。错误信息如下:
项目的module cherrypvk-sdk 依赖了第三方jar[cat-client:jar:1.2.1-mv-SNAPSHOT]

错误的原因大致是 没有在阿里云仓库中找到 cat-client:jar:1.2.1-mv-SNAPSHOT 信息

[ERROR] Failed to execute goal on project KeMachine-sdk: Could not resolve dependencies for project com.sachin:cherrypvk-sdk:jar:2.1.0.11-0.0.1-SNAPSHOT: Failed to collect dependencies at com.dianping.cat:cat-client:jar:1.2.1-mv-SNAPSHOT: Failed to read artifact descriptor for com.dianping.cat:cat-client:jar1.2.1-mv-SNAPSHOT: Failure to find com.dianping.cat:parent:pom:1.4.0 in https://maven.aliyun.com/repo... was cached in the local repository, resolution will not be reattempted until the update interval of nexus-aliyun has elapsed or updates are forced -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project cherrypvk-sdk: Could not resolve dependencies for project com.sachin:cherrypvk-sdk:jar:2.1.0.11-0.0.1-SNAPSHOT: Failed to collect dependencies at com.dianping.cat:cat-client:jar:1.2.1-mv-SNAPSHOT

Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find com.dianping.cat:parent:pom:1.4.0 in https://maven.aliyun.com/repo... was cached in the local repository, resolution will not be reattempted until the update interval of nexus-aliyun has elapsed or updates are forced

相关参考:
https://stackoverflow.com/que...

这个问题该如何处理?

阅读 2k
1 个回答

建议这么做:

  1. 先删掉你本地的这个 artifact(完整删除,连目录都删了)
  2. 重新安装到本地仓库
  3. 增加 -o 选项,离线模式运行
  4. 如果用idea的面板打包,那么记得把idea的maven配置那里也选下 offline 模式
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题