Skip to content

Spring Boot 4.0 Draft Release Notes

Phillip Webb edited this page Oct 22, 2025 · 2 revisions

Upgrading from Spring Boot 3.5

Since this is a major release of Spring Boot, upgrading existing applications can be a little more involved that usual. We’ve put together a dedicated migration guide to help you upgrade your existing Spring Boot 3.5 applications.

If you’re currently running with an earlier version of Spring Boot, we strongly recommend that you upgrade to Spring Boot 3.5 before migrating to Spring Boot 4.0.

New and Noteworthy

Tip
Check the configuration changelog for a complete overview of the changes in configuration.

Milestones Available from Maven Central

Starting with 4.0.0-M1, All Spring Boot milestones (and release candidates) are now published to Maven Central in addition to https://repo.spring.io. This should make it easier to try new milestones in the 4.x line as they become available.

Gradle 9

Gradle 9 is now supported for building Spring Boot applications. Support for Gradle 8.x (8.14 or later) remains.

HTTP Service Clients

Spring Boot now includes auto-configuration support and configuration properties for HTTP Service Clients. HTTP Service Clients allow you to annotate plain Java interfaces and have Spring automatically create implementations of them.

For example, the following interface can be used to call an "echo" service:

@HttpExchange(url = "https://echo.zuplo.io")
public interface EchoService {

	@PostExchange
	Map<?, ?> echo(@RequestBody Map<String, String> message);

}

For full details of the feature, please see the updated documentation.

API Versioning

Auto-configuration has been added for API Versioning with Spring MVC and with Spring WebFlux.

API Versioning can be configured using the spring.mvc.apiversion.* or spring.webflux.apiversion.* properties. For more advanced control, beans of type ApiVersionResolver, ApiVersionParser and ApiVersionDeprecationHandler can be defined.

See the reference documentation (MVC, WebFlux) for further details.

JmsClient

The auto-configuration for JMS now includes support for the new JmsClient API. The support for JmsTemplate and JmsMessagingTemplate is left unchanged.

Task Decoration

The auto-configurations for task scheduling and task execution now support multiple TaskDecorator beans. When the context contains multiple TaskDecorator beans, a CompositeTaskDecorator that delegates to them is created. The individual decorators are called in the ordered defined by @Order and Ordered.

OpenTelemetry starter

A new starter, spring-boot-starter-opentelemetry has been added. This starter brings in all necessary dependencies to export metrics and traces over OTLP. It will also auto-configure the OpenTelemetry SDK.

Configuration Properties Metadata for External Types

It is now possible for @ConfigurationProperties-annotated types to refer to types that are located in a different module. To source the metadata from those modules, you should add the annotation processor (if necessary) and flag the type with @ConfigurationPropertiesSource.

See the reference documentation for more details.

SSL Info

Support for the certificate validity threshold has been removed from the SSL info contribution. A certificate that had a status of WILL_EXPIRE_SOON will now appear as VALID. The information about the start and end of a certificate’s validity remains.

SSL Health

Certificate chains that contain one or more certificates that will expire within the configured threshold (management.health.ssl.certificate-validity-warning-threshold) are now listed in a new expiringChains entry in the details of the health response. The status WILL_EXPIRE_SOON is no longer used and expiring certificates will have a status of VALID.

MongoDB Health Indicators

The MongoDB health indicators have been reworked so that they no longer require Spring Data MongoDB. This allows health information to be provided when using the MongoDB Java Driver directly.

As part of this change, the health indicators have moved from spring-boot-data-mongodb to spring-boot-mongodb. Their packages have also been updated accordingly.

MongoDB Properties

A new property, spring.data.mongodb.representation.big-decimal, has been introduced to control how Spring Data MongoDB stores BigDecimal (and BigInteger) values in MongoDB.

A number of properties have also been renamed. See the migration guide for details.

Kotlin Serialization

Spring Boot now ships a new "spring-boot-kotlin-serialization" module and corresponding "spring-boot-kotlin-serialization-starter" for Kotlin Serialization support. This will contribute a Json bean and configure it with the available spring.kotlin.serialization.* properties. Note that a HttpMessageConverter will be also contributed to the application and will be set ahead of other JSON converters (acting as fallbacks).

RestTestClient

Support for the newly introduced RestTestClient has been added.

With a regular @SpringBootTest or when @AutoConfigureMockMvc is used, you can autowire a RestTestClient that operates on the underlying MockMvc instance.

For integration tests, i.e. @SpringBootTest with either a defined or random port, a RestTestClient can be injected to target the running server.

Redis Static Master/Replica

Auto-configuration for Static Master/Replica has been added. This feature is only supported by Lettuce.

To use it, provide the list of static nodes using the new spring.data.redis.masterreplica.nodes property.

Redis Observability

The Redis auto-configuration has been improved to auto-configure MicrometerTracing, rather than MicrometerCommandLatencyRecorder. The former operates on the Observation API and provides both metrics and spans.

Dependency Upgrades

Spring Boot 4.0 moves to new versions of several Spring projects:

Numerous third-party dependencies have also been updated, some of the more noteworthy of which are the following:

Miscellaneous

Apart from the changes listed above, there have also been lots of minor tweaks and improvements including:

  • The auto-configuration for Micrometer’s metrics aspects now enables support for @MeterTag on @Counted and @Timed methods with a SpEL-based ValueExpressionResolver.

  • @ServiceConnection support for MongoDB now supports Testcontainers' MongoDBAtlasLocalContainer.

  • Improved error message when configuration property binding fails due to a class not found error.

  • Names of several reactive auto-configuration classes have been updated for consistency.

  • Public members (aside from constants) have been removed from auto-configuration classes. Auto-configurations never have been public API and now this is enforced through Java mechanisms.

  • Auto-configured HTTP clients backed by the JDK HttpClient are now configured to use virtual threading when spring.threads.virtual.enabled is true.

  • A logging.console.enabled property has been introduced. Setting it to false disables console logging.

  • Log4j Core configuration file detection for Log4j 3 has been improved.

  • Resource lookup in DevTools restart has been optimized.

  • ScheduledTasksObservabilityAutoConfiguration has been renamed to ScheduledTasksObservationAutoConfiguration for consistency.

  • Authenticating with Elasticsearch using an API key is now supported using the new spring.elasticsearch.api-key property.

  • ConditionalOnEnabledTracing has been renamed to ConditionalOnEnabledTracingExport.

  • The property management.tracing.enabled has been renamed to management.tracing.export.enabled.

  • SanitizableData.getKey() and SanitizableData.getLowerCaseKey() never return null. Passing a null value as a key in the SanitizableData will now throw an exception.

  • Specialized interfaces have been introduced in PropertiesConfigAdapter for better nullability handling.

  • The property spring.dao.exceptiontranslation.enabled has been renamed to spring.persistence.exceptiontranslation.enabled.

  • The max size of Tomcat’s static cache can now be configured using the server.tomcat.resource.cache-max-size property.

  • The JSpecify nullability annotations have been refined further.

  • You can now set Spring-Boot-Jar-Type to development-tool in your MANIFEST.MF to exclude dependencies from uber jars.

  • Amazon Web Services (AWS) Elastic Container Service (ECS) platform is now a recognized CloudPlatform.

  • Support for Micrometer’s @ObservationKeyValue has been added.

  • JSpecify nullability annotations have been refined further.

  • Public members from configurations imported by auto-configuration classes have been made package-private.

  • HTML Unit LocalHostWebClient and LocalHostWebConnectionHtmlUnitDriver have been superseded by UriBuilderFactoryWebClient and UriBuilderFactoryWebConnectionHtmlUnitDriver.

  • A new configuration property can be used to control whether the Elasticsearch Client’s sniffer is enabled.

Deprecations in Spring Boot 4.0.0

  • OperationMethod(Method method, OperationType operationType) in favor of OperationMethod(Method method, OperationType operationType, Predicate<Parameter> optionalParameters).

  • Jackson 2 support ships in a deprecated form.

  • org.springframework.boot.env.EnvironmentPostProcessor has replaced by org.springframework.boot.EnvironmentPostProcessor but the old interface remains in a deprecated form to ease upgrade pain.

Clone this wiki locally