resolution will not be reattempted until the update interva

在idea的项目里
环境
Java:1.8
maven:3.6.1
操作:
在父工程里添加了接口的模块A
在模块B里引用A里的接口
报错如下:

Failed to execute goal on project HelloConsumer01: Could not resolve dependencies for project com.offcn:HelloConsumer01:jar:1.0: Failed to collect dependencies at com.offcn:HelloInterface01:jar:1.0: Failed to read artifact descriptor for com.offcn:HelloInterface01:jar:1.0: Failure to find com.offcn:hello-parent:pom:1.0 in https://mirrors.huaweicloud.com/repository/maven was cached in the local repository, resolution will not be reattempted until the update interval of huaweicloud has elapsed or updates are forced -> [Help 1]
[ERROR] 

错误解释:
原因上面也说了,要么等更新时间过去,要么强制更新。
maven的默认更新时间为day,即一天更新一次。

所以我们一般都是采用强制更新的方式。
1)找到maven 的 setting.xml 添加如下代码
在这里插入图片描述

<profile>
  <id>nexus</id>
  <!--Enable snapshots for the built in central repo to direct -->
  <!--all requests to nexus via the mirror -->
  <repositories>
    <repository>
      <id>central</id>
      <url>http://central</url>
      <releases><enabled>true</enabled><updatePolicy>always</updatePolicy></releases>
      <snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots>
    </repository>
  </repositories>
<pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <url>http://central</url>
      <releases><enabled>true</enabled><updatePolicy>always</updatePolicy></releases>
      <snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots>
    </pluginRepository>
  </pluginRepositories>
</profile>

2)取消勾勾在这里插入图片描述
3)找到你的仓库,清除仓库了的包
在这里插入图片描述
4)关闭idea,然后重新打开,再进行启动测试,没得问题了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一叶一码农

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值