Spring Boot 版本列表
Spring Boot 版本列表
Spring Boot 版本列表
1 Spring Boot 版本
注意: Spring Boot 版本变化快,最新版本以官网为准。
| Spring Framework | Spring Boot | System Requirements | boot support |
|---|---|---|---|
| 5.3.31+ | 2.7.18 | Java 8+/Maven 3.5+/Gradle 6.8.x+/Tomcat 9.0/Undertow 2.0 | 2.7.x/2022-05-19/2023-06-30 |
| 6.0.14+ | 3.0.13 | Java 17/Maven 3.5+/Gradle 7.5+/Tomcat 10.1/Undertow 2.3 | 3.0.x/2022-11-24/2023-12-31 |
| 6.0.21+ | 3.1.12 | Java 17/Maven 3.6.3+/Gradle 7.5+/Tomcat 10.1/Undertow 2.3 | 3.1.x/2023-05-18/2024-06-30 |
| 6.1.x+ | 3.2.12 | Java 17/Maven 3.6.3+/Gradle 7.5+/Tomcat 10.1/Undertow 2.3 | 3.2.x/2023-11-23/2024-12-31 |
| 6.1.17+ | 3.3.9 | Java 17/Maven 3.6.3+/Gradle 7.5+/Tomcat 10.1.25+/Undertow 2.3 | 3.3.x/2024-05-23/2025-06-30 |
| 6.2.11+ | 3.4.10 | Java 17/Maven 3.6.3+/Gradle 7.x+/Tomcat 10.1.25+/Undertow 2.3+ | 3.4.x/2024-11/2025-12 |
| 6.2.11+ | 3.5.6 | Java 17/Maven 3.6.3+/Gradle 7.6.4+/Tomcat 10.1.25+/Undertow 2.3+ | 3.5.x/2025-05/2026-06 |
2 Spring Cloud 版本列表
注意: Spring Cloud 版本变化快,最新版本以官网为准。
| spring cloud | spring boot |
|---|---|
| 2021.0.9 | 2.6.15 |
| 2022.0.5 | 3.0.13 |
| 2023.0.5 | 3.2.12 |
| 2024.0.2 | 3.4.7 |
3 Spring Boot 参数优先级
Externalized Configuration Link
- Command line arguments.
- Java System properties (
System.getProperties()). - OS environment variables.
- Config data (such as
application.propertiesfiles).
Spring Boot uses a very particular PropertySource order that is designed to allow sensible overriding of values. Later property sources can override the values defined in earlier ones. Sources are considered in the following order:
- Default properties (specified by setting
SpringApplication.setDefaultProperties). @PropertySourceannotations on your@Configurationclasses. Please note that such property sources are not added to theEnvironmentuntil the application context is being refreshed. This is too late to configure certain properties such aslogging.*andspring.main.*which are read before refresh begins.- Config data (such as
application.propertiesfiles). - A
RandomValuePropertySourcethat has properties only inrandom.*. - OS environment variables.
- Java System properties (
System.getProperties()). - JNDI attributes from
java:comp/env. ServletContextinit parameters.ServletConfiginit parameters.- Properties from
SPRING_APPLICATION_JSON(inline JSON embedded in an environment variable or system property). - Command line arguments.
propertiesattribute on your tests. Available on@SpringBootTestand the test annotations for testing a particular slice of your application.@DynamicPropertySourceannotations in your tests.@TestPropertySourceannotations on your tests.- Devtools global settings properties in the
$HOME/.config/spring-bootdirectory when devtools is active.
Config data files are considered in the following order:
- Application properties packaged inside your jar (
application.propertiesand YAML variants). - Profile-specific application properties packaged inside your jar (
application-{profile}.propertiesand YAML variants). - Application properties outside of your packaged jar (
application.propertiesand YAML variants). - Profile-specific application properties outside of your packaged jar (
application-{profile}.propertiesand YAML variants).
It is recommended to stick with one format for your entire application. If you have configuration files with both
.propertiesand YAML format in the same location,.propertiestakes precedence.
4 Spring Boot 配置文件优先级
External Application Properties Link
Spring Boot will automatically find and load application.properties and application.yaml files from the following locations when your application starts:
- From the classpath
- The classpath root
- The classpath
/configpackage
- From the current directory
- The current directory
- The
config/subdirectory in the current directory - Immediate child directories of the
config/subdirectory
The list is ordered by precedence (with values from lower items overriding earlier ones). Documents from the loaded files are added as PropertySources to the Spring Environment.