微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

SpringBoot与SpringCloud的版本对应详细版

  1. 作者:梦幻朵颜
  2. 出处: https: //www.cnblogs.com/zhuwenjoyce/
  3. 你的一个点赞,一句留言,都将是博主的前进动力!!!
  4. 版权:本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

大版本对应:

Spring BootSpring Cloud
1.2.xAngel版本
1.3.xBrixton版本
1.4.x stripesCamden版本
1.5.xDalston版本、Edgware版本
2.0.xFinchley版本
2.1.xGreenwich.SR2

在实际开发过程中,我们需要更详细的版本对应  (https://start.spring.io/actuator/info)

 

spring-boot-starter-parentspring-cloud-dependencies
版本号发布日期 版本号发布日期 
1.5.2.RELEASE2017年3月稳定版Dalston.RC12017年未知月 
1.5.9.RELEASE2017年11月稳定版Edgware.RELEASE2017年11月稳定版
1.5.16.RELEASE  Edgware.SR5  
1.5.20.RELEASE  Edgware.SR5  
Spring Boot >=2.0.0.M3 and <2.0.0.M5  Finchley.M2  
Spring Boot >=2.0.0.M5 and <=2.0.0.M5  Finchley.M3  
Spring Boot >=2.0.0.M6 and <=2.0.0.M6  Finchley.M4  
Spring Boot >=2.0.0.M7 and <=2.0.0.M7  Finchley.M5  
Spring Boot >=2.0.0.RC1 and <=2.0.0.RC1  Finchley.M6  
Spring Boot >=2.0.0.RC2 and <=2.0.0.RC2  Finchley.M7  
Spring Boot >=2.0.0.RELEASE and <=2.0.0.RELEASE  Finchley.M9  
 Spring Boot >=2.0.1.RELEASE and <2.0.2.RELEASE   Finchley.RC1  
Spring Boot >=2.0.2.RELEASE and <2.0.3.RELEASE  Finchley.RC2  
Spring Boot >=2.0.3.RELEASE and <2.0.999.BUILD-SNAPSHOT  Finchley.SR4  
Spring Boot >=2.0.999.BUILD-SNAPSHOT and <2.1.0.M3  Finchley.BUILD-SNAPSHOT  
Spring Boot >=2.1.0.M3 and <2.1.0.RELEASE  Greenwich.M1  
Spring Boot >=2.1.0.RELEASE and <2.1.9.BUILD-SNAPSHOT  Greenwich.SR2  
Spring Boot >=2.1.9.BUILD-SNAPSHOT and <2.2.0.M4  Greenwich.BUILD-SNAPSHOT  
Spring Boot >=2.2.0.M4 and <=2.2.0.M5  Hoxton.M2  
Spring Boot >=2.2.0.BUILD-SNAPSHOT  Hoxton.BUILD-SNAPSHOT  
 待更新...     

 

spring官方对应查看网址:https://start.spring.io/actuator/info

复制代码

spring-cloud    
Finchley.M2                     "Spring Boot >=2.0.0.M3 and <2.0.0.M5"
Finchley.M3                     "Spring Boot >=2.0.0.M5 and <=2.0.0.M5"
Finchley.M4                     "Spring Boot >=2.0.0.M6 and <=2.0.0.M6"
Finchley.M5    "Spring Boot >=2.0.0.M7 and <=2.0.0.M7"
Finchley.M6    "Spring Boot >=2.0.0.RC1 and <=2.0.0.RC1"
Finchley.M7    "Spring Boot >=2.0.0.RC2 and <=2.0.0.RC2"
Finchley.M9    "Spring Boot >=2.0.0.RELEASE and <=2.0.0.RELEASE"
Finchley.RC1    "Spring Boot >=2.0.1.RELEASE and <2.0.2.RELEASE"
Finchley.RC2    "Spring Boot >=2.0.2.RELEASE and <2.0.3.RELEASE"
Finchley.SR4    "Spring Boot >=2.0.3.RELEASE and <2.0.999.BUILD-SNAPSHOT"
Finchley.BUILD-SNAPSHOT    "Spring Boot >=2.0.999.BUILD-SNAPSHOT and <2.1.0.M3"
Greenwich.M1    "Spring Boot >=2.1.0.M3 and <2.1.0.RELEASE"
Greenwich.SR2    "Spring Boot >=2.1.0.RELEASE and <2.1.9.BUILD-SNAPSHOT"
Greenwich.BUILD-SNAPSHOT    "Spring Boot >=2.1.9.BUILD-SNAPSHOT and <2.2.0.M4"
Hoxton.M2    "Spring Boot >=2.2.0.M4 and <=2.2.0.M5"
Hoxton.BUILD-SNAPSHOT    "Spring Boot >=2.2.0.BUILD-SNAPSHOT"

复制代码

 

 

 

 

 

spring-cloud-dependencies 版本列表可查看:  

https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies

spring-boot-starter-parent 版本列表可查看:

https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent

在SpringCloud中,1.X和2.X版本在pom.xml中引入的jar包名字都不一样,比如有的叫spirng-cloud-starter-hystrix 有的叫spring-cloud-netflix-hystrix,维护起来会比较困难。

1.x版本pom.xml里几个基本用到的jar长这样:


     
  1. <project xmlns= "http://maven.apache.org/POM/4.0.0"
  2. xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  4. <modelVersion> 4.0. 0</modelVersion>
  5. <groupId>com.joyce</groupId>
  6. <artifactId>joyce-test</artifactId>
  7. <version> 1.0</version>
  8. <packaging>jar</packaging>
  9. <parent>
  10. <groupId>org.springframework.boot</groupId>
  11. <artifactId>spring-boot-starter-parent</artifactId>
  12. <version> 1.5. 9.RELEASE</version>
  13. <relativePath />
  14. </parent>
  15. <dependencyManagement>
  16. <dependencies>
  17. <dependency>
  18. <groupId>org.springframework.cloud</groupId>
  19. <artifactId>spring-cloud-dependencies</artifactId>
  20. <version>Edgware.RELEASE</version>
  21. <type>pom</type>
  22. <scope> import</scope>
  23. </dependency>
  24. </dependencies>
  25. </dependencyManagement>
  26. <properties>
  27. <project.build.sourceEncoding>UTF- 8</project.build.sourceEncoding>
  28. </properties>
  29. <dependencies>
  30. <dependency>
  31. <groupId>org.springframework.cloud</groupId>
  32. <artifactId>spring-cloud-starter-feign</artifactId>
  33. </dependency>
  34. <dependency>
  35. <groupId>org.springframework.cloud</groupId>
  36. <artifactId>spring-cloud-starter-hystrix</artifactId>
  37. </dependency>
  38. <dependency>
  39. <groupId>org.springframework.cloud</groupId>
  40. <artifactId>spring-cloud-starter-zipkin</artifactId>
  41. </dependency>
  42. <dependency>
  43. <groupId>org.springframework.cloud</groupId>
  44. <artifactId>spring-cloud-starter-eureka</artifactId>
  45. </dependency>
  46. <dependency>
  47. <groupId>org.springframework.boot</groupId>
  48. <artifactId>spring-boot-starter-actuator</artifactId>
  49. </dependency>
  50. <dependency>
  51. <groupId>org.springframework.boot</groupId>
  52. <artifactId>spring-boot-starter-web</artifactId>
  53. <exclusions>
  54. <!-- 排除spring boot认使用的tomcat,使用jetty -->
  55. <exclusion>
  56. <groupId>org.springframework.boot</groupId>
  57. <artifactId>spring-boot-starter-tomcat</artifactId>
  58. </exclusion>
  59. </exclusions>
  60. </dependency>
  61. <dependency>
  62. <groupId>org.springframework.boot</groupId>
  63. <artifactId>spring-boot-starter-jetty</artifactId>
  64. </dependency>
  65. <dependency>
  66. <groupId>org.springframework.cloud</groupId>
  67. <artifactId>spring-cloud-starter-ribbon</artifactId>
  68. </dependency>
  69. <dependency>
  70. <groupId>org.springframework.boot</groupId>
  71. <artifactId>spring-boot-starter-test</artifactId>
  72. <scope>test</scope>
  73. </dependency>
  74. </dependencies>
  75. </project>

在SpringBoot 1.5.9.RELEASE 版本中,junit测试类模版长这样:


     
  1. import org.junit.Test;
  2. import org.junit.runner.RunWith;
  3. import org.slf4j.LoggerFactory;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.boot.test.context.SpringBoottest;
  6. import org.springframework.test.context.junit4.springrunner;
  7. import org.springframework.web.client.RestTemplate;
  8. @RunWith(springrunner.class)
  9. @SpringBoottest(classes=MyApplication.class)
  10. public class MyApplicationTest {
  11. private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(MyApplicationTest.class);
  12. @Autowired
  13. private RestTemplate restTemplate;
  14. @Test
  15. public void test() {
  16. System.out.println( "ok!!!");
  17. }
  18. @Test
  19. public void orderName() {
  20. try {
  21. String name = "joyce";
  22. String rr = restTemplate.getForObject( "http://joyce-user/orderName?name="+name, String.class);
  23. LOG.info("rr====" + rr);
  24. } catch (Exception e) {
  25. e.printstacktrace();
  26. }
  27. }
  28. }

 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐