是否有 Spring-boot 和 Spring-cloud 的兼容性矩阵?

新手上路,请多包涵

我想知道 Springboot 和 Springcloud 之间是否存在兼容性矩阵?

我在 STS 上创建了一个简单的项目,但遇到了兼容性问题。

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.1.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

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

对 Springboot 和 Springcloud 的受支持版本有一个很好的了解会让事情变得更简单。

我确实观察到了一个关于这种需求的公开问题 - https://github.com/spring-cloud/spring-cloud-build/issues/43

社区在开始 SpringCloud 项目时是否有方法来选择如何开始使用特定版本组合?

编辑:添加自昨天以来我遇到的此类问题的另一个实例

来自 pom.xml 的片段

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
         <version>1.5.2.RELEASE</version>
        <!--<version>1.5.2.RELEASE</version> -->
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <!-- <version>Camden.SR6</version -->
                <!-- <version>Brixton.SR5</version> -->
                <!--  <version>Camden.SR6</version> -->
                <version>Camden.SR5</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

将 1.5.2.RELEASE 与 Camden.SR5 一起使用没有 maven 错误,但是当应用程序启动时,它会抛出 NoClassDefFoundError。

 2017-03-28 09:51:15.148 ERROR 15808 --- [           main] o.s.boot.SpringApplication               : Application startup failed

java.lang.NoClassDefFoundError: org/springframework/cloud/context/named/NamedContextFactory$Specification
    at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_112]
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[na:1.8.0_112]
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_112]
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[na:1.8.0_112]
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[na:1.8.0_112]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_112]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_112]
    at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_112]
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[na:1.8.0_112]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_112]
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_112]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_112]
    at org.springframework.cloud.netflix.feign.FeignClientsRegistrar.registerClientConfiguration(FeignClientsRegistrar.java:367) ~[spring-cloud-netflix-core-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    at org.springframework.cloud.netflix.feign.FeignClientsRegistrar.registerDefaultConfiguration(FeignClientsRegistrar.java:104) ~[spring-cloud-netflix-core-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    at org.springframework.cloud.netflix.feign.FeignClientsRegistrar.registerBeanDefinitions(FeignClientsRegistrar.java:87) ~[spring-cloud-netflix-core-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:352) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:143) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:320) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:270) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:686) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
    at com.forecastessentials.school.SchoolUniformForecastApplication.main(SchoolUniformForecastApplication.java:12) [classes/:na]
Caused by: java.lang.ClassNotFoundException: org.springframework.cloud.context.named.NamedContextFactory$Specification
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_112]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_112]
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_112]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_112]
    ... 31 common frames omitted

将 1.4.5 与 Brixton.SR6 结合使用通常对我来说效果很好。

原文由 Manglu 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 816
1 个回答

2022 年 7 月更新

Spring Cloud 发布火车 Spring Boot 兼容性

兼容性矩阵

春云弹簧靴2021.0.3+ 又名禧年2.6.x、2.7.x 2021.0.x 又名禧年2.6.x 2020.0.3+ 又名伊尔福德2.4.x、2.5.x 2020.0.x 又名 Ilford 2.4.x

⚠ Spring Cloud 以下版本均已停产,不再支持。

春云弹簧靴霍斯顿.SR5+ 2.2.x,2.3.x霍克斯顿2.2.x格林威治2.1.x芬奇利2.0.x埃奇韦尔1.5.x达尔斯顿1.5.x卡姆登.SR5+ 1.4.x、1.5.x卡姆登1.4.x布里克斯顿1.3.x,1.4.x天使1.2.x

⚠ 以下是 Spring Cloud 的里程碑(预览版)。

春云弹簧靴2022.0.0-M4 3.0.0-M4 2022.0.0-M3 3.0.0-M3 2022.0.0-M2 3.0.0-M2 2022.0.0-M1 3.0.0-M1 2021.0.0-M2 2.6.0-M3

资料来源:

  1. Spring Cloud 项目页面
  2. Spring Cloud 2021.0.0-M2(代号Jubilee)上市
  3. Spring Cloud 2021.0.0(代号Jubilee)已经发布
  4. Spring Cloud 路线图和 EOL 公告
  5. 2022.0.0-M1 PRE 参考文档
  6. Spring Cloud 2022.0.0-M2(代号Kilburn)已经发布
  7. Spring Cloud 2022.0.0-M3(代号Kilburn)已经发布

原文由 naXa stands with Ukraine 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题