resolution will not be reattempted until the update interval of xxx has elapsed or updates are force

本文详细阐述了在使用Maven构建项目时遇到的依赖解析失败问题,包括错误信息的具体内容,以及如何通过修改setting.xml文件中的更新策略来解决该问题。提供了具体的配置示例,并解释了强制更新依赖的方法。

Maven在执行中报错:

Failed to execute goal on project ms-marketing-biz: 
Could not resolve dependencies for project com.x x.service:xx:jar:1.0-SNAPSHOT:
 Failed to collect dependencies at com.xx.service:xx:jar:1.0-SNAPSHOT: Failed to read artifact descriptor for com.xx.service:xx:jar:1.0-SNAPSHOT: Failure to find com.xx.service:xx:pom:1.0-SNAPSHOT in http://nexus.xx.com/repository/maven-public/ was cached in the local repository, resolution will not be reattempted until the update interval of xx has elapsed or updates are forced -> [Help 1]
[ERROR] 

解决方法是 在setting.xml中增加一个更新策略,如下:

<profile>
      <id>profile-miaosuan</id>
      <repositories>
        <repository>
          <id>miaosuan-repo-public</id>
          <url>http://nexus.miaosuankeji.com/repository/maven-releases/</url>
          <releases>
            <enabled>true</enabled>
             <updatePolicy>always</updatePolicy>
          </releases>
          <snapshots>
            <enabled>false</enabled>
             <updatePolicy>always</updatePolicy>
          </snapshots>
        </repository>
        <repository>
          <id>miaosuan-repo-snapshots</id>
          <url>http://nexus.miaosuankeji.com/repository/maven-snapshots/</url>
          <releases>
            <enabled>false</enabled>
             <updatePolicy>always</updatePolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
             <updatePolicy>always</updatePolicy>
          </snapshots>
        </repository>
      </repositories>
    </profile>

执行以下语句

mvn clean install -U

有这种说法

如果你去本地的maven仓库,你会发现,其只有lastUpdate结尾的文件,没有jar包。

这个时候,你无论怎么点击IDEA中的Reimports All Maven Projects都是没有用的。原因上面也说了,要么等更新时间过去,要么强制更新。
maven的默认更新时间为day,即一天更新一次。

所以我们一般都是采用强制更新的方式。

 

但我的仓库中也都ok的  不过再尝试上面两个步骤后也搞定了 
还有就是遇到类似的直接去删除私服对应jar包

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值