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

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包

猜你喜欢

转载自blog.csdn.net/loveme888/article/details/102812686
今日推荐