17年的一个老项目,使用的是springboot1.5.2.RELEASE,现在要升级到2.2.10.RELEASE,记录一下升级过程遇到的问题。
问题1:resolution will not be reattempted until the update interval of XXX has elapsed or updates are force
主要错误消息,如题:
就是resolution will not be reattempted until the update interval of XXX has elapsed or updates are force
意思就是:
在 XXX的更新间隔过去或强制更新之前,不会重新尝试解析。
如果你去本地的maven仓库,你会发现,其只有lastUpdate结尾的文件,没有jar包。
这个时候,你无论怎么点击IDEA中的Reimports All Maven Projects都是没有用的。原因上面也说了,要么等更新时间过去,要么强制更新。
maven的默认更新时间为day,即一天更新一次。
所以我们一般都是采用强制更新的方式。
解决办法
命令行的方式
mvn clean install -U
修改settings.xml
添加<updatePolicy>always</updatePolicy>
;
<repositories>
<repository>
<id>xr-snapshots</id>
<url>http://nexus.alibaba.com/repository/snapshots/</url>
<snapshots>
<enabled>true</enabled>
<!-- 注意 -- >
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>false</enabled>
<!-- 注意 -- >
<updatePolicy>always</updatePolicy>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>xr-plugins</id>
<name>xingren plugins</name>
<url>http://nexus.alibaba.com/repository/public/</url>
<releases>
<enabled>true</enabled>
<!-- 注意 -- >
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<!-- 注意 -- >
<updatePolicy>always</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
总结
在确定远程仓库jar
包存在,配置也没有错的情况下,
使用强制更新。
标题:SpringBoot 1.x升级到2.x遇到的问题
作者:从一滴水开始
地址:http://blog.lizhenhua.fun/articles/2021/04/01/1617241180263.html