当前位置:   article > 正文

spring cloud和spring boot兼容版本对照表_springboot3.0.0对应的springcloud的版本

springboot3.0.0对应的springcloud的版本

摘自:https://blog.csdn.net/qq32933432/article/details/89375630

缘起
初学spring cloud的朋友可能不知道,其实SpringBoot与SpringCloud需要版本对应,否则可能会造成很多意料之外的错误,比如eureka注册了结果找不到服务类啊,比如某些jar导入不进来啊,等等这些错误。下面列出来springBoot和spring cloud的版本对应关系,需要配套使用,才不会出现各种奇怪的错误。

关于maven仓库的版本列表
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

版本对应关系
大版本对应:

关于spring cloud1.x版本和2.x版本区别
spring cloud各个版本之间是有所区别的,比如在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>

而在2.x版本中,比如我们需要eureka,去maven仓库中可能会看到deprecated, please use spring-cloud-starter-netflix-eureka-client这类提示,包括使用ribbon也会有


所以个人猜测2.x中统一用
spring-cloud-starter-netflix-xx 替换了原有的 spring-cloud-starter-xx(此处如有不正确请指出)
所以2.x的版本pom.xml类似如下这样

  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <groupId>com.forezp</groupId>
  5. <artifactId>service-feign</artifactId>
  6. <version>0.0.1-SNAPSHOT</version>
  7. <packaging>jar</packaging>
  8. <name>service-feign</name>
  9. <description>Demo project for Spring Boot</description>
  10. <parent>
  11. <groupId>com.forezp</groupId>
  12. <artifactId>sc-f-chapter3</artifactId>
  13. <version>0.0.1-SNAPSHOT</version>
  14. </parent>
  15. <dependencies>
  16. <dependency>
  17. <groupId>org.springframework.cloud</groupId>
  18. <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
  19. </dependency>
  20. <dependency>
  21. <groupId>org.springframework.boot</groupId>
  22. <artifactId>spring-boot-starter-web</artifactId>
  23. </dependency>
  24. <dependency>
  25. <groupId>org.springframework.cloud</groupId>
  26. <artifactId>spring-cloud-starter-openfeign</artifactId>
  27. </dependency>
  28. </dependencies>
  29. </project>

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/794189
推荐阅读
相关标签
  

闽ICP备14008679号