spring boot版本和spring cloud版本的匹配关系
SpringCloud | Springboot |
---|---|
Finchley | 兼容springboot 2.0.x,不兼容springboot 1.5.x |
Dalston和Edgware | 兼容springboot 1.5.x,不兼容springboot 2.0.x |
Camden | 兼容springboot1.4.x,不兼容springboot 1.5.x |
Brixton | 兼容springboot 1.3.x ,也兼容Springboot 1.4.x |
Angel | 兼容springboot 1.2.x |
只要按照上述表格做springboot和springcloud的关系匹配,就不会出现报该错。
由springboot1.4.1转2.0.5版本注意事项
- Springdata jpa:findOne使用findById(Id)来代替…对返回的Optional.isPresent()判断…避免使用getOne
- SpringCloud:统一使用 Finchley.SR3
pom.xml统一添加依赖管理(dependencies的节点能尽量不指定版本)
<dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Finchley.SR3</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
- spring-cloud-starter-eureka版本统一使用1.4.0
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-eureka</artifactId> <version>1.4.0.RELEASE</version> </dependency>