是否有 Spring-boot 和 Spring-cloud 的兼容性矩阵?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42659920/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there a compatibility matrix of Spring-boot and Spring-cloud?
提问by Manglu
I am wondering if a compatibility matrix exists between Springboot and Springcloud?
我想知道 Springboot 和 Springcloud 之间是否存在兼容性矩阵?
I created a simple project on STS and am running into compatibility issues.
我在 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>
Having a good view of the supported versions of both Springboot and Springcloud will make things simpler.
对 Springboot 和 Springcloud 的受支持版本有一个很好的了解将使事情变得更简单。
I did observe an open issue that talks about this need - https://github.com/spring-cloud/spring-cloud-build/issues/43
我确实观察到一个讨论这种需求的公开问题 - https://github.com/spring-cloud/spring-cloud-build/issues/43
Does the community have an approach on how they choose to get started on a specific version combination when they embark on a SpringCloud project?
社区是否有关于他们在着手 SpringCloud 项目时如何选择开始特定版本组合的方法?
Edit: Adding another instance of such a problem that I encountered since yesterday
编辑:添加我从昨天起遇到的此类问题的另一个实例
snippets from pom.xml
来自 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>
There are no maven errors in using 1.5.2.RELEASE with Camden.SR5 however when the app starts it throws the NoClassDefFoundError.
使用 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.access0(URLClassLoader.java:73) ~[na:1.8.0_112]
at java.net.URLClassLoader.run(URLClassLoader.java:368) ~[na:1.8.0_112]
at java.net.URLClassLoader.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
Using 1.4.5 with Brixton.SR6 is a combination that generally works well for me.
将 1.4.5 与 Brixton.SR6 结合使用是一种对我来说通常效果很好的组合。
回答by Strelok
If you follow the quick-start on http://projects.spring.io/spring-cloud/it tells you the compatible versions. Camden release train is not compatible with Spring Boot 1.5.x
如果您遵循http://projects.spring.io/spring-cloud/上的快速入门,它会告诉您兼容的版本。Camden 发行版与 Spring Boot 1.5.x 不兼容
You can also read the release notes for each release which notes compatible component versions:
您还可以阅读每个版本的发行说明,其中说明了兼容的组件版本:
https://github.com/spring-projects/spring-cloud/wiki/Spring-Cloud-Camden-Release-Notes:
https://github.com/spring-projects/spring-cloud/wiki/Spring-Cloud-Camden-Release-Notes:
Spring Cloud Camden builds on Spring Boot 1.4.x.
Spring Cloud Camden 基于 Spring Boot 1.4.x 构建。
回答by Stefanos Kalantzis
Yes there is: http://start.spring.io/actuator/info
是的,有:http: //start.spring.io/actuator/info
It includes more libraries than just spring-cloud, but not every single one of them.
它包括的库不仅仅是 spring-cloud,但不是每一个。
回答by naXa
Source: https://spring.io/projects/spring-cloud
来源:https: //spring.io/projects/spring-cloud
Spring Cloud release train Spring Boot compatibility
Spring Cloud 发布火车 Spring Boot 兼容性
------------------------------
| Release Train | Boot Version |
| ------------- | ------------ |
| Hoxton | 2.2.x |
| Greenwich | 2.1.x |
| Finchley | 2.0.x |
| Edgware | 1.5.x |
| Dalston | 1.5.x |
| Camden | 1.4.x |
| Brixton | 1.3.x, 1.4.x |
| Angel | 1.2.x |
--------------- --------------
回答by t0r0X
2020 and it still is tedious to find the latest matching versions...
2020年了,找最新的匹配版本还是很乏味的……
- Look up in https://spring.io/projects/spring-cloudthe
Release Trainstable, and choose the Spring Boot version and Spring Cloud Release Train you need. Release trains as of 2020-02-27:
- Find the latest matching Spring Boot version in https://github.com/spring-projects/spring-boot/releases.
- Find the latest matching Spring Cloud Release Train version in https://github.com/spring-cloud/spring-cloud-release/releases
- 在https://spring.io/projects/spring-cloud 中查找该
Release Trains表,并选择您需要的 Spring Boot 版本和 Spring Cloud Release Train。截至 2020-02-27 的发布列车:
- 在https://github.com/spring-projects/spring-boot/releases 中找到最新匹配的 Spring Boot 版本。
- 在https://github.com/spring-cloud/spring-cloud-release/releases 中找到最新匹配的 Spring Cloud Release Train 版本
Another info source is the Spring Blog category "releases": https://spring.io/blog/category/releases, but imho that is ... confusing.
另一个信息来源是 Spring 博客类别“发布”:https: //spring.io/blog/category/releases,但恕我直言,这是......令人困惑。

