从springBoot1.X到springboot2.X 不念不忘少年蓝@ 2022-03-26 04:21 209阅读 0赞 1. 修改版本号 <table> <thead> <tr> <td style="border-color:#C0C0C0;"> <p style="margin-left:0cm;"><strong><span style="color:#000000;">Spring Cloud</span></strong></p> </td> <td style="border-color:#C0C0C0;"> <p style="margin-left:0cm;"><strong><span style="color:#000000;">Spring Boot</span></strong></p> </td> </tr> </thead> <tbody> <tr> <td style="border-color:#C0C0C0;"> <p style="margin-left:0cm;"><span style="color:#000000;">Finchley</span></p> </td> <td> <p style="margin-left:0cm;"><span style="color:#000000;">兼容</span><span style="color:#000000;">Spring Boot 2.0.x</span><span style="color:#000000;">,不兼容</span><span style="color:#000000;">Spring Boot 1.5.x</span></p> </td> </tr> <tr> <td style="border-color:#C0C0C0;"> <p style="margin-left:0cm;"><span style="color:#000000;">Dalston</span><span style="color:#000000;">和</span><span style="color:#000000;">Edgware</span></p> </td> <td> <p style="margin-left:0cm;"><span style="color:#000000;">兼容</span><span style="color:#000000;">Spring Boot 1.5.x</span><span style="color:#000000;">,不兼容</span><span style="color:#000000;">Spring Boot 2.0.x</span></p> </td> </tr> <tr> <td style="border-color:#C0C0C0;"> <p style="margin-left:0cm;"><span style="color:#000000;">Camden</span></p> </td> <td> <p style="margin-left:0cm;"><span style="color:#000000;">兼容</span><span style="color:#000000;">Spring Boot 1.4.x</span><span style="color:#000000;">,也兼容</span><span style="color:#000000;">Spring Boot 1.5.x</span></p> </td> </tr> <tr> <td style="border-color:#C0C0C0;"> <p style="margin-left:0cm;"><span style="color:#000000;">Brixton</span></p> </td> <td> <p style="margin-left:0cm;"><span style="color:#000000;">兼容</span><span style="color:#000000;">Spring Boot 1.3.x</span><span style="color:#000000;">,也兼容</span><span style="color:#000000;">Spring Boot 1.4.x</span></p> </td> </tr> <tr> <td style="border-color:#C0C0C0;"> <p style="margin-left:0cm;"><span style="color:#000000;">Angel</span></p> </td> <td> <p style="margin-left:0cm;"><span style="color:#000000;">兼容</span><span style="color:#000000;">Spring Boot 1.2.x</span></p> </td> </tr> </tbody> </table> 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,都是默认实现
还没有评论,来说两句吧...