最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

解決springboot與springcloud版本兼容問題(附版本兼容表)

 更新時間:2024年02月25日 14:29:02   作者:寒山李白  
在基于spring boot搭建spring cloud時,創(chuàng)建eureka后啟動服務發(fā)生報錯,本文給大家介紹了解決springboot與springcloud版本兼容問題的幾種方案,需要的朋友可以參考下

1. 場景描述(產(chǎn)生環(huán)境)

在基于spring boot搭建spring cloud時,創(chuàng)建eureka后啟動服務發(fā)生報錯,報錯內(nèi)容如下,如覺得繁瑣可直接看第三步解決方法進行嘗試,或可直接解決問題。

注: 使用zuul的場景有些特殊,所以放在最后講,如果是zuul使用的報錯請移步5

2. 報錯代碼(控制臺)

2.1 報錯1

Error creating bean with name 'configurationPropertiesBeans' defined in class path resource [org/springframework/cloud/autoconfigure/ConfigurationPropertiesRebinderAutoConfiguration.class]: Bean

試了幾次,有時候還會出現(xiàn)下面的報錯-報錯2

2.2 報錯2

Could not find artifact org.springframework.cloud:spring-cloud-starter-netflix-eureka-server:pom:2021.0.5 in alimaven (http://maven.aliyun.com/nexus/content/groups/public/)

兩個版本都能對應上之后啟動項目又出現(xiàn)了新的報錯-報錯3

2.3 報錯3

org.springframework.cloud:spring-cloud-starter-netflix-eureka-server:jar:unknown was not found in http://maven.aliyun.com/nexus/content/groups/public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of alimaven has elapsed or updates are forced

如果報錯3的問題也解決了,這個時候使用的兩個不兼容的版本,如果刷新依賴也沒報錯的話,啟動項目后正常會報下面的錯,如報錯4

2.4 報錯4

使用springboot2.7.3和springcloud2020.0.5后啟動項目出現(xiàn)如下報錯

Action:

Consider applying the following actions:

- Change Spring Boot version to one of the following versions [2.4.x, 2.5.x] .
You can find the latest Spring Boot versions here [https://spring.io/projects/spring-boot#learn]. 
If you want to learn more about the Spring Cloud Release train compatibility, you can visit this page [https://spring.io/projects/spring-cloud#overview] and check the [Release Trains] section.
If you want to disable this check, just set the property [spring.cloud.compatibility-verifier.enabled=false]

3. 解決方法

3.1 針對報錯1、報錯2、報錯4的解決

百度后確定是版本不兼容問題,于是按照網(wǎng)上某博主版本列表配對,本章末尾附版本對照表可供參考。

我使用的版本是spring boot的2.7.3以及spring cloud的2021.0.5
還試了

spring boot的2.5.3以及spring cloud的2020.0.5

spring boot的2.1.4.RELEASE以及spring cloud的Greenwich.RELEASE

這三個版本都是親測可用的(順利起了服務并訪問成功)

3.2 針對報錯3的解決

版本確定沒配錯,那么這個報錯3如果發(fā)生了,可以按照如下解決
在依賴中添加type和scope標簽,如下

在父類pom.xml中配置如下

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.3</version>
    </parent>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>2021.0.5</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

雖然不知道原理,但的確解決了報錯3這個問題

4. 總結

正常版本兼容問題常常發(fā)生,所以一般使用偏老一點的依賴來用會減少一些問題,但很多情況下即使使用老的版本也會出現(xiàn)問題。

只要按照下面的方式來配置一般不會有毛病。

父項目pom.xml中的配置添加如下:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.3</version>
    </parent>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                    <version>2021.0.5</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

子模塊項目的pom.xml配置如下:

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
        </dependency>
    </dependencies>

5. zuul使用的報錯與解決

使用兼容列表里對應的spring boot和spring cloud版本后,springcloud中的eureka等其他功能正常,但使用zuul時啟動zuul服務后出現(xiàn)了報錯,此時可嘗試使用以下兩個版本:spring boot 的2.2.4.RELEASE和spring cloud 的Hoxton.SR12一般可解決問題

我遇到的是如下報錯:

org.springframework.cloud:spring-cloud-starter-netflix-zuul:jar:unknown was not found in http://maven.aliyun.com/nexus/content/groups/public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of alimaven has elapsed or updates are forced

以上兩個報錯都可將springboot和spring cloud的版本換為上面推薦的2.2.4.RELEASE和Hoxton.SR12即可解決問題

6. spring boot和spring cloud版本兼容表

SpringCloud版本SpringBoot版本
2022.0.0-M2Spring Boot >=3.0.0-M2 and < 3.1.0-M1
2022.0.0-M1Spring Boot >=3.0.0-M1 and < 3.0.0-M2
2021.0.3Spring Boot >=2.6.1 and < 3.0.0-M1
2021.0.0-RC1Spring Boot >=2.6.0-RC1 and <2.6.1
2021.0.0-M3Spring Boot >=2.6.0-M3 and <2.6.0-RC1
2021.0.0-M1Spring Boot >=2.6.0-M1 and <2.6.0-M3
2020.0.5Spring Boot >=2.4.0.M1 and <2.6.0-M1
Hoxton.SR12Spring Boot >=2.2.0.RELEASE and <2.4.0.M1
Hoxton.BUILD-SNAPSHOTSpring Boot >=2.2.0.BUILD-SNAPSHOT
Hoxton.M2Spring Boot >=2.2.0.M4 and <=2.2.0.M5
Greenwich.BUILD-SNAPSHOSpring Boot >=2.1.9.BUILD-SNAPSHOT and <2.2.0.M4
Greenwich.SR2Spring Boot >=2.1.0.RELEASE and <2.1.9.BUILD-SNAPSHOT
Greenwich.M1Spring Boot >=2.1.0.M3 and <2.1.0.RELEASE
Finchley.BUILD-SNAPSHOTSpring Boot >=2.0.999.BUILD-SNAPSHOT and <2.1.0.M3
Finchley.SR4Spring Boot >=2.0.3.RELEASE and <2.0.999.BUILD-SNAPSHOT
Finchley.RC2Spring Boot >=2.0.2.RELEASE and <2.0.3.RELEASE
Finchley.RC1Spring Boot >=2.0.1.RELEASE and <2.0.2.RELEASE
Finchley.M9Spring Boot >=2.0.0.RELEASE and <=2.0.0.RELEASE
Finchley.M7Spring Boot >=2.0.0.RC2 and <=2.0.0.RC2
Finchley.M6Spring Boot >=2.0.0.RC1 and <=2.0.0.RC1
Finchley.M5Spring Boot >=2.0.0.M7 and <=2.0.0.M7
Finchley.M4Spring Boot >=2.0.0.M6 and <=2.0.0.M6
Finchley.M3Spring Boot >=2.0.0.M5 and <=2.0.0.M5
Finchley.M2Spring Boot >=2.0.0.M3 and <2.0.0.M5
Edgware.SR51.5.20.RELEASE
Edgware.SR51.5.16.RELEASE
Edgware.RELEASE1.5.9.RELEASE
Dalston.RC11.5.2.RELEASE

以上就是解決springboot與springcloud版本兼容問題(附版本兼容表)的詳細內(nèi)容,更多關于springboot與springcloud版本兼容的資料請關注腳本之家其它相關文章!

相關文章

  • gRPC實踐之proto及Maven插件概念及使用詳解

    gRPC實踐之proto及Maven插件概念及使用詳解

    這篇文章主要為大家介紹了gRPC實踐之proto及Maven插件概念及使用詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2023-04-04
  • Java運算符從見過到掌握下

    Java運算符從見過到掌握下

    計算機的最基本用途之一就是執(zhí)行數(shù)學運算,作為一門計算機語言,Java也提供了一套豐富的運算符來操縱變量,本篇對大家的學習或工作具有一定的價值,緊接上篇,需要的朋友可以參考下
    2021-09-09
  • Java壓縮文件為ZIP并加密的詳細步驟

    Java壓縮文件為ZIP并加密的詳細步驟

    Zip是一種常用的文件壓縮格式,下面這篇文章主要給大家介紹了關于Java壓縮文件為ZIP并加密的詳細步驟,文中通過代碼介紹的非常詳細,需要的朋友可以參考下
    2023-11-11
  • SpringBoot環(huán)境Druid數(shù)據(jù)源使用及特點

    SpringBoot環(huán)境Druid數(shù)據(jù)源使用及特點

    Druid 是目前比較流行的高性能的,分布式列存儲的OLAP框架(具體來說是MOLAP)。本文給大家分享SpringBoot環(huán)境Druid數(shù)據(jù)源使用及特點介紹,感興趣的朋友跟隨小編一起看看吧
    2021-07-07
  • mybaits-spring的實現(xiàn)方式

    mybaits-spring的實現(xiàn)方式

    這篇文章主要介紹了mybaits-spring的實現(xiàn)方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-05-05
  • java.util.Date和java.time.LocalDate對比及分析

    java.util.Date和java.time.LocalDate對比及分析

    本文介紹了java.util.Date和java.time下的日期兩種日期類型的區(qū)別和使用場景,前者表示一個瞬時時間點,包含日期+時間,后者僅表示純?nèi)掌?后者時區(qū)無關聯(lián),而前者依賴操作系統(tǒng)時區(qū)顯示,兩者之間可以相互轉換,并且可以格式化輸出
    2026-05-05
  • += 和 ++ 操作符區(qū)別簡單介紹

    += 和 ++ 操作符區(qū)別簡單介紹

    這篇文章主要介紹了+= 和 ++ 操作符區(qū)別簡單介紹的相關資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下
    2016-09-09
  • 使用SpringBoot+AOP實現(xiàn)可插拔式日志的示例代碼

    使用SpringBoot+AOP實現(xiàn)可插拔式日志的示例代碼

    這篇文章主要介紹了使用SpringBoot+AOP實現(xiàn)可插拔式日志的示例代碼,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2019-07-07
  • java使用CollectionUtils工具類判斷集合是否為空方式

    java使用CollectionUtils工具類判斷集合是否為空方式

    這篇文章主要介紹了java使用CollectionUtils工具類判斷集合是否為空方式,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-02-02
  • 詳解Spring Boot微服務如何集成fescar解決分布式事務問題

    詳解Spring Boot微服務如何集成fescar解決分布式事務問題

    這篇文章主要介紹了詳解Spring Boot微服務如何集成fescar解決分布式事務問題,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2019-01-01

最新評論

宽甸| 东宁县| 资溪县| 聂拉木县| 大同市| 天水市| 泰兴市| 建水县| 绥棱县| 应城市| 梁平县| 天峻县| 阿瓦提县| 获嘉县| 镇安县| 华阴市| 晋城| 萝北县| 静乐县| 山阴县| 林周县| 西林县| 横峰县| 融水| 湟源县| 宣威市| 原阳县| 高阳县| 马尔康县| 奉新县| 大宁县| 邵阳县| 承德县| 扎鲁特旗| 徐州市| 分宜县| 高陵县| 城口县| 扎囊县| 兴山县| 贵港市|