国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁技術(shù)文章
文章詳情頁

詳解SpringBoot與SpringCloud的版本對應(yīng)詳細版

瀏覽:4日期:2023-04-24 11:32:09

緣起

初學(xué)spring cloud的朋友可能不知道,其實SpringBoot與SpringCloud需要版本對應(yīng),否則可能會造成很多意料之外的錯誤,比如eureka注冊了結(jié)果找不到服務(wù)類啊,比如某些jar導(dǎo)入不進來啊,等等這些錯誤。下面列出來springBoot和spring cloud的版本對應(yīng)關(guān)系,需要配套使用,才不會出現(xiàn)各種奇怪的錯誤。

關(guān)于maven倉庫的版本列表

spring-cloud-dependencies 版本列表可查看:https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependenciesspring-boot-starter-parent 版本列表可查看:https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent

版本對應(yīng)關(guān)系

大版本對應(yīng):

Spring Cloud Spring Boot Angel版本 兼容Spring Boot 1.2.x Brixton版本 兼容Spring Boot 1.3.x,也兼容Spring Boot 1.4.x Camden版本 兼容Spring Boot 1.4.x,也兼容Spring Boot 1.5.x Dalston版本、Edgware版本 兼容Spring Boot 1.5.x,不兼容Spring Boot 2.0.x Finchley版本 兼容Spring Boot 2.0.x,不兼容Spring Boot 1.5.x Greenwich版本 兼容Spring Boot 2.1.x Hoxtonl版本 兼容Spring Boot 2.2.x

在實際開發(fā)過程中,我們需要更詳細的版本對應(yīng):

Spring Boot Spring Cloud 1.5.2.RELEASE Dalston.RC1 1.5.9.RELEASE Edgware.RELEASE 2.0.2.RELEASE Finchley.BUILD-SNAPSHOT 2.0.3.RELEASE Finchley.RELEASE 2.1.0.RELEASE-2.1.14.RELEASE Greenwich.SR5 2.2.0.M4 Hoxton.SR4

關(guān)于spring cloud1.x版本和2.x版本區(qū)別

spring cloud各個版本之間是有所區(qū)別的,比如在SpringCloud中,1.X和2.X版本在pom.xml中引入的jar包名字都不一樣,比如有的叫spirng-cloud-starter-hystrix 有的叫spring-cloud-netflix-hystrix,維護起來會比較困難。

1.x版本pom.xml里幾個基本用到的jar長這樣:

<project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd'> <modelVersion>4.0.0</modelVersion> <groupId>com.joyce</groupId> <artifactId>joyce-test</artifactId> <version>1.0</version> <packaging>jar</packaging> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.9.RELEASE</version> <relativePath /> </parent> <dependencyManagement> <dependencies> <dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>Edgware.RELEASE</version><type>pom</type><scope>import</scope> </dependency> </dependencies> </dependencyManagement> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-feign</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-hystrix</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-zipkin</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-eureka</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions><!-- 排除spring boot默認使用的tomcat,使用jetty --><exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId></exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jetty</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-ribbon</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies></project>

而在2.x版本中,比如我們需要eureka,去maven倉庫中可能會看到deprecated, please use spring-cloud-starter-netflix-eureka-client這類提示,包括使用ribbon也會有

詳解SpringBoot與SpringCloud的版本對應(yīng)詳細版

詳解SpringBoot與SpringCloud的版本對應(yīng)詳細版

所以個人猜測2.x中統(tǒng)一用spring-cloud-starter-netflix-xx 替換了原有的 spring-cloud-starter-xx(此處如有不正確請指出)所以2.x的版本pom.xml類似如下這樣

<project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd'> <modelVersion>4.0.0</modelVersion> <groupId>com.forezp</groupId> <artifactId>service-feign</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>service-feign</name> <description>Demo project for Spring Boot</description> <parent> <groupId>com.forezp</groupId> <artifactId>sc-f-chapter3</artifactId> <version>0.0.1-SNAPSHOT</version> </parent> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-openfeign</artifactId> </dependency> </dependencies> </project>

到此這篇關(guān)于詳解SpringBoot與SpringCloud的版本對應(yīng)詳細版的文章就介紹到這了,更多相關(guān)SpringBoot與SpringCloud版本對應(yīng)內(nèi)容請搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!

標簽: Spring
相關(guān)文章:
主站蜘蛛池模板: 亚洲精品国产一区二区在线 | 一区二区三区免费视频观看 | 日韩国产欧美精品综合二区 | 免费一级性片 | 日本欧美精品 | 亚洲精品成人一区 | 国产亚洲精品久久久久久 | 国产亚洲欧美久久精品 | 国产精品久久久天天影视香蕉 | 欧美性色生活免费观看 | 久久福利青草狠狠午夜 | 久久青草国产手机看片福利盒子 | 91久久福利国产成人精品 | 亚洲一区二区三区精品影院 | 国产精品日本欧美一区二区 | 怡红院老首页主页入口 | 精品亚洲视频在线 | 韩国午夜三级理论 | 久久亚洲国产午夜精品理论片 | 国产精品国色综合久久 | 色伊人国产高清在线 | 亚洲韩国欧美一区二区三区 | 欧美另类自拍 | 久热色| 成人污网站 | 在线观看免费a∨网站 | 国产精品久久国产精品99盘 | 亚洲国产成人久久笫一页 | 国产精选在线播放 | 色综合久久久久久888 | 久久精品中文字幕不卡一二区 | 看v片 | 99精品高清不卡在线观看 | 免费看男女做好爽好硬视频 | 欧美精品高清在线观看 | 成人午夜影院 | 国产欧美精品午夜在线播放 | 最新欧美精品一区二区三区不卡 | 99久久香蕉 | 亚洲综合在线观看视频 | 国产精品hd在线播放 |