Spring Boot 版本2023年选择指南

目前 Spring Boot 框架的版本主要有以下三个系列可选择(截至到2023年8月28日):

  • 3.1.x系列(当前最新为3.1.3)
  • 3.0.x系列(当前最新为3.0.10)
  • 2.7.x系列(当前最新为2.7.15)

那么以上三个系列该如何选择呢?

我们先来看看每个系列的差别有哪些。

1. 技术支持时长

Spring Boot 版本2023年选择指南_第1张图片

可以看到,2.7.x系列的官方技术支持截止到2023-11-18,3.0.x系列截止到2023-11-24,3.2.x系列截止到2024-11-23。


2. 系统要求

Spring Boot 2.7.x requires Java 8 and is compatible up to and including Java 20. Spring Framework 5.3.29 or above is also required.

Explicit build support is provided for the following build tools:

Build Tool Version
Maven 3.5+
Gradle 6.8.x, 6.9.x, 7.x, and 8.x

Spring Boot 3.0.x requires Java 17 and is compatible up to and including Java 20. Spring Framework 6.0.11 or above is also required.

Explicit build support is provided for the following build tools:

Build Tool Version
Maven 3.5+
Gradle 7.x (7.5 or later) and 8.x

Spring Boot 3.1.x requires Java 17 and is compatible up to and including Java 20. Spring Framework 6.0.11 or above is also required.

Explicit build support is provided for the following build tools:

Build Tool Version
Maven 3.6.3 or later
Gradle 7.x (7.5 or later) and 8.x

2.1 Servlet Containers

Spring Boot 2.7.x supports the following embedded servlet containers:

Name Servlet Version
Tomcat 9.0 4.0
Jetty 9.4 3.1
Undertow 2.0 4.0

You can also deploy Spring Boot applications to any Servlet 3.1 or 4.0 compatible container.

Spring Boot 3.0.x supports the following embedded servlet containers:

Name Servlet Version
Tomcat 10.1 6.0
Jetty 11.0 5.0
Undertow 2.3 6.0

You can also deploy Spring Boot applications to any servlet 5.0+ compatible container.

Spring Boot 3.1.x supports the following embedded servlet containers:

Name Servlet Version
Tomcat 10.1 6.0
Jetty 11.0 5.0
Undertow 2.3 6.0

You can also deploy Spring Boot applications to any servlet 5.0+ compatible container.

参考官网 spring.io/projects/spring-boot#learn


综上所述,根据官方技术支持的时长限制,如果是新建项目,建议使用3.1.x系列版本进行开发,如果是现有项目,请注意框架版本所支持的最长支持时间,最长使用时间不宜超过社区维护的时间,否则安全风险难以控制。

你可能感兴趣的:(springboot)