关于springboot: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. 技术支持时长

能够看到,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系列版本进行开发,如果是现有我的项目,请留神框架版本所反对的最长反对工夫,最长应用工夫不宜超过社区保护的工夫,否则平安危险难以管制。

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理