Spring Cloud Alibaba与Spring Boot、Spring Cloud之间不得不说的版本关系

2019/03/06

现阶段版本的特殊性

现在的Spring Cloud Alibaba由于没有纳入到Spring Cloud的主版本管理中,所以我们需要自己去引入其版本信息,比如之前教程中的例子:

1.  `<dependencyManagement>`

2.  `<dependencies>`

3.  `<dependency>`

4.  `<groupId>org.springframework.cloud</groupId>`

5.  `<artifactId>spring-cloud-dependencies</artifactId>`

6.  `<version>Finchley.SR1</version>`

7.  `<type>pom</type>`

8.  `<scope>import</scope>`

9.  `</dependency>`

10.  `<dependency>`

11.  `<groupId>org.springframework.cloud</groupId>`

12.  `<artifactId>spring-cloud-alibaba-dependencies</artifactId>`

13.  `<version>0.2.1.RELEASE</version>`

14.  `<type>pom</type>`

15.  `<scope>import</scope>`

16.  `</dependency>`

17.  `</dependencies>`

18.  `</dependencyManagement>`

而不是像以往使用Spring Cloud的时候,直接引入Spring Cloud的主版本(Dalston、Edgware、Finchley、Greenwich这些)就可以的。我们需要像上面的例子那样,单独的引入 spring-cloud-alibaba-dependencies来管理Spring Cloud Alibaba下的组件版本。

由于Spring Cloud基于Spring Boot构建,而Spring Cloud Alibaba又基于Spring Cloud Common的规范实现,所以当我们使用Spring Cloud Alibaba来构建微服务应用的时候,需要知道这三者之间的版本关系。

下表整理了目前Spring Cloud Alibaba的版本与Spring Boot、Spring Cloud版本的兼容关系:

Spring Boot Spring Cloud Spring Cloud Alibaba
2.1.x Greenwich 0.2.2(还未RELEASE)
2.0.x Finchley 0.2.1
1.5.x Edgware 0.1.1
1.5.x Dalston 0.1.1

所以,不论您是在读我的《Spring Boot基础教程》、《Spring Cloud基础教程》还是正在连载的《Spring Cloud Alibaba系列教程》。当您照着博子的顺序,一步步做下来,但是没有调试成功的时候,强烈建议检查一下,您使用的版本是否符合上表的关系。

推荐:Spring Cloud Alibaba基础教程

该系列教程的代码示例:

  • Github:https://github.com/dyc87112/SpringCloud-Learning/

  • Gitee:https://gitee.com/didispace/SpringCloud-Learning/

Post Directory