本文主要是介绍从springBoot1.X到springboot2.X,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
- 修改版本号
Spring Cloud | Spring Boot |
Finchley | 兼容Spring Boot 2.0.x,不兼容Spring Boot 1.5.x |
Dalston和Edgware | 兼容Spring Boot 1.5.x,不兼容Spring Boot 2.0.x |
Camden | 兼容Spring Boot 1.4.x,也兼容Spring Boot 1.5.x |
Brixton | 兼容Spring Boot 1.3.x,也兼容Spring Boot 1.4.x |
Angel | 兼容Spring Boot 1.2.x |
2.修改eureka /feign /redis /zuul 依赖为:
<!--服务提供者-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<!-- Feign -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
</dependency>
3.修改redis配置
spring.redis.hostName
spring.redis.port
spring.redis.password
spring.redis.timeout
spring.redis.jedis.pool.max-active
spring.redis.jedis.pool.max-wait=-1ms
spring.redis.jedis.pool.max-idle
spring.redis.jedis.pool.min-idle
4. 修改网关路由配置方式
zuul.routes.sso.serviceId----服务/应用名称
zuul.routes.sso.stripPrefix--- 转发时带上前缀(项目名),默认脱离前缀转发
zuul.routes.sso.path---- 应用访问路径前缀 格式:/itsm/system/sso/**
5.修改配置项server.context-path
2.X版本是server.servlet.context-path
6.WebMvcConfigurerConfigure方法已过期,改为implements WebMvcConfigurer,都是默认实现
这篇关于从springBoot1.X到springboot2.X的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!