springboot+springcloud从1.x+Dalston升级到最新2.x+Hoxton

有了springboot从1.x升级到2.x的经验,以为springcloud也就是换个版本号的事,实际上还是经历了一些波折。

spring官方不会保证SpringBoot和SpringCloud不同版本的兼容性。

要升级,先看springboot与springcloud兼容版本,要不然各种幺蛾子。

SpringCloud版本SpringBoot版本
Hoxton 2.2.x2.2.x
Greenwich 2.1.x2.1.x
Finchley 2.0.x2.0.x
Edgware 1.5.x1.5.x
Dalston 1.5.x1.5.x
Finchley.M2>=2.0.0.M3 and <2.0.0.M5
Finchley.M3>=2.0.0.M5 and <=2.0.0.M5
Finchley.M4>=2.0.0.M6 and <=2.0.0.M6
Finchley.M5>=2.0.0.M7 and <=2.0.0.M7
Finchley.M6>=2.0.0.RC1 and <=2.0.0.RC1
Finchley.M7>=2.0.0.RC2 and <=2.0.0.RC2
Finchley.M9>=2.0.0.RELEASE and <=2.0.0.RELEASE
Finchley.RC1>=2.0.1.RELEASE and <2.0.2.RELEASE
Finchley.RC2>=2.0.2.RELEASE and <2.0.3.RELEASE
Finchley.SR4>=2.0.3.RELEASE and <2.0.999.BUILD-SNAPSHOT
Finchley.BUILD-SNAPSHOT>=2.0.999.BUILD-SNAPSHOT and <2.1.0.M3
Greenwich.M1>=2.1.0.M3 and <2.1.0.RELEASE
Greenwich.SR5>=2.1.0.RELEASE and <2.1.14.BUILD-SNAPSHOT
Greenwich.BUILD-SNAPSHOT>=2.1.14.BUILD-SNAPSHOT and <2.2.0.M4
Hoxton.SR6>=2.2.0.M4 and <2.3.0.BUILD-SNAPSHOT

 

 

 

 

 

 

 

 我这里选择的版本是springboot:2.2.8.RELEASE,springcloud:Hoxton.SR6

首先发现eureka包不一样了

<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
<dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>

eurekaServer起来后,dashboard无法访问了,404找不到

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu Jul 23 10:40:09 CST 2020
There was an unexpected error (type=Not Found, status=404).
No message available

据说增加一步配置即可搞定:spring.freemarker.prefer-file-system-access=false

重启后还是不行啊!!!

过程中切换了多次版本号,有的jar包下不动,手工取消了,导致项目编译时很多jar包加载报错了。

xxx.jar.in project 'SpringBoot' cannot be read or is not a valid ZIP file”

到maven仓库中去找到“xxx.jar”删除后重新update Project,问题解决。

还是不行,网上看了好多,都说freemarker配置一行搞定,但是有的人还是不成功。

打开MavenDebug模式,install的时候,发现了几行小小的错误,但是不影响编译成功。

错误: 读取D:\apache-maven-3.2.5\resp\lib\org\freemarker\freemarker\2.3.30\freemarker-2.3.30.jar时出错;

错误: 读取D:\apache-maven-3.2.5\resp\lib\org\glassfish\jaxb\jaxb-runtime\2.3.3\jaxb-runtime-2.3.3.jar时出错;

到maven仓库中去找到“xxx.jar”删除后重新update Project,问题解决。

maven重新加载pom.xml的时候,如果卡住不动了,千万别取消,老美的网站总是连接超时,有些包在ali的仓库也不存在!

I have a dream!jar包秒下!秒下!秒下!

阿里私有仓先到pom.xml

<repositories>
		<repository>
			<id>spring-snapshots</id>
			<name>Spring Snapshots</name>
			<url>http://maven.aliyun.com/nexus/content/groups/public</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
		<repository>
			<id>spring-milestones</id>
			<name>Spring Milestones</name>
			<url>http://maven.aliyun.com/nexus/content/groups/public</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
	</repositories>

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值