:boot-docs: https://docs.spring.io/spring-boot/4.0-SNAPSHOT
:framework-api-docs: https://docs.spring.io/spring-framework/docs/7.0.x-SNAPSHOT/javadoc-api/org/springframework

= Spring Boot 4.0.0-M3 Release Notes

For changes in earlier milestones, please refer to:

- link:Spring-Boot-4.0.0-M2-Release-Notes[v4.0.0-M2]
- link:Spring-Boot-4.0.0-M1-Release-Notes[v4.0.0-M1]



== Upgrading from Spring Boot 3.5



=== Migration Guide

To help with upgrading, a https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide[migration guide] is available.



=== Jackson

Spring Boot now uses Jackson 3 as its preferred JSON library.
Jackson 3 uses new group IDs and package names with `com.fasterxml.jackson` becoming `tools.jackson`.
An exception to this is the `jackson-annotations` module which continues to use the `com.fasterxml.jackson.core` group ID and `com.fasterxml.jackson.annotation` package.
To learn more about the changes in Jackson 3, refer to the https://github.com/FasterXML/jackson/wiki/Jackson-Release-3.0#major-changesfeatures-in-30[Jackson wiki].

For libraries that require Jackson 2, dependency management for Jackson 2 remains and a manually configured Jackson 2 `ObjectMapper` can be used alongside Boot's auto-configuration for Jackson 3 if needed.

A number of classes have been renamed for consistency with Jackson 3:

* `JsonObjectSerializer` to `ObjectValueSerializer`.
* `JsonValueDeserializer` to `ObjectValueDeserializer`.
* `Jackson2ObjectMapperBuilderCustomizer` to `JsonMapperBuilderCustomizer`.



=== AOP starter renamed to AspectJ

To clarify the scope of `spring-boot-starter-aop`, it has been renamed to `spring-boot-starter-aspectj`.
If you have added the starter explicitly in your application, please review if you actually need it before using the replacement.

If your application does not use AspectJ, typically an annotation in the `org.aspectj.lang.annotation` package, you probably do not need the starter at all.



=== MongoDB UUID and BigDecimal Representations

Spring Data MongoDB no longer provide defaults for UUID and BigInteger/BigDecimal representations.
This aligns with the driver recommendation to not favor a particular representation for UUID or BigInteger/BigDecimal to avoid representation changes caused by upgrades to a newer Spring Data version.

An explicit configuration is expected and the representations can be set using the `spring.mongodb.representation.uuid` and `spring.data.mongodb.representation.big-decimal` properties, respectively.



=== Dependency Management for Spring Retry

With the portfolio moving from Spring Retry to new core features of {framework-api-docs}/core/retry/package-summary.html[Spring Framework], dependency management for Spring Retry has been removed.

If your application still relies on Spring Retry, an explicit version is now required.
Please consider moving your use of Spring Retry to Spring Framework.



=== Spring Kafka Retry Features

Spring Kafka has moved its retry capabilities from Spring Retry to {framework-api-docs}/core/retry/package-summary.html[Spring Framework].

As a result, `spring.kafka.retry.topic.backoff.random` has been removed in favor of `spring.kafka.retry.topic.backoff.jitter`.
The latter provides more flexibility over the former. See {boot-docs}/appendix/application-properties/index.html#application-properties.integration.spring.kafka.retry.topic.backoff.jitter[the documentation] for more details.



=== Spring AMQP Retry Features

Spring AMQP has moved its retry capabilities from Spring Retry to {framework-api-docs}/core/retry/package-summary.html[Spring Framework].

Spring Boot offers a customization hook-point for retry features used by the `RetryTemplate` and message listeners.
To make it more explicit, two dedicated customizers have been introduced: `RabbitTemplateRetrySettingsCustomizer`, and `RabbitListenerRetrySettingsCustomizer`.

If you were using `RabbitRetryTemplateCustomizer` to customize the retry settings according to a target, you will need to migrate to either of those interfaces.



=== Property Mapper API Changes

The `PropertyMapper` class no longer calls adapter or predicate methods by default when the source value is `null`.
This has removed the need for the `alwaysApplyingNotNull()` method which has been removed.

If you need to perform a mapping even for `null` values you can use the new `always()` method.

For example,

[,java]
----
map.from(source::method).to(destination::method);
----
    
Will not call `destination.method(...)` if `source.method()` returns `null`.
    
Where as:

[,java]
----
map.from(source::method).always().to(destination::method);
----
    
Will call  `destination.method(null)` if `source.method()` returns `null`.

If you use the `PropertyMapper`, you might want to review https://github.com/spring-projects/spring-boot/commit/239f384ac0893d151b89f204886874c6adb00001[commit `239f384ac0`] which shows how Spring Boot itself adapted to the new API.


=== Optional Actuator Endpoint Parameters

Optional actuator endpoint parameters must now be annotated with JSpecify's `@Nullable`.
The previously introduced `@OptionalParameter` has been removed in this milestone.
If you were using it, please use `org.jspecify.annotations.Nullable` instead.



=== Dependency Management for Spring Authorization Server

Spring Authorization Server is now https://spring.io/blog/2025/09/11/spring-authorization-server-moving-to-spring-security-7-0[part of Spring Security].
Explicit dependency management has been removed in favor of what's already provided by Spring Security.

As a result, you can no longer override the version of Spring Authorization Server using the `spring-authorization-server.version` property.
If you need to do this going forward, use `spring-security.version`.



=== Liveness and Readiness Probes

The liveness and readiness probes are now enabled by default.
This means the health endpoint now exposes the `liveness` and `readiness` groups by default.

If you do not need those probes, you can disable them by using the `management.endpoint.health.probes.enabled` property.



=== Persistence Modules

A new `spring-boot-persistence` module has been created to house general persistence-related code and properties.
Users of `@EntityScan` should adapt their imports to `org.springframework.boot.persistence.autoconfigure.EntityScan`.

The `spring.dao.exceptiontranslation.enabled` property is no longer supported.
Please use `spring.persistence.exceptiontranslation.enabled` instead.


=== BootstrapRegistry and EnvironmentPostProcessor package changes

The `BootstrapRegistry` and related classes have moved form `org.springframework.boot` to `org.springframework.boot.bootstrap`. The `EnvironmentPostProcessor` interface has also moved from `org.springframework.boot.env` to `org.springframework.boot`.

If you have deep integrations with Spring Boot you may need to update both your code and your `spring.factories` files.


=== Minimum Requirements Changes

None.



== New and Noteworthy

TIP: Check link:Spring-Boot-4.0.0-M3-Configuration-Changelog[the configuration changelog] for a complete overview of the changes in configuration.



=== 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.



==== 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 https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide#mongodb[migration guide] for details.



=== Jackson

`spring.jackson.datetime.<feature-name>` properties can be used to enable and disable `DataTimeFeature` settings on the auto-configured `JsonMapper`.



=== 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).



=== Dependency Upgrades

Spring Boot 4.0.0-M3 moves to new versions of several Spring projects:

* https://github.com/micrometer-metrics/micrometer/releases/tag/v1.16.0-M3[Micrometer 1.16.0-M3]
* https://github.com/micrometer-metrics/tracing/releases/tag/v1.6.0-M3[Micrometer Tracing 1.6.0-M3]
* https://github.com/reactor/reactor/releases/tag/2025.0.0-M7[Reactor Bom 2025.0.0-M7]
* https://github.com/spring-projects/spring-batch/releases/tag/v6.0.0-M3[Spring Batch 6.0.0-M3]
* https://github.com/spring-projects/spring-data-bom/releases/tag/2025.1.0-M6[Spring Data Bom 2025.1.0-M6]
* https://github.com/spring-projects/spring-framework/releases/tag/v7.0.0-M9[Spring Framework 7.0.0-M9]
* https://github.com/spring-projects/spring-graphql/releases/tag/v2.0.0-M3[Spring GraphQL 2.0.0-M3]
* https://github.com/spring-projects/spring-integration/releases/tag/v7.0.0-M3[Spring Integration 7.0.0-M3]
* https://github.com/spring-projects/spring-ldap/releases/tag/4.0.0-M3[Spring LDAP 4.0.0-M3]
* https://github.com/spring-projects/spring-hateoas/releases/tag/3.0.0-M5[Spring HATEOAS 3.0.0-M5]
* https://github.com/spring-projects/spring-ldap/releases/tag/4.0.0-M3[Spring LDAP 4.0.0-M3]
* https://github.com/spring-projects/spring-pulsar/releases/tag/v2.0.0-M3[Spring Pulsar 2.0.0-M3]
* https://github.com/spring-projects/spring-restdocs/releases/tag/v4.0.0-M3[Spring RESTDocs 4.0.0-M3]
* https://github.com/spring-projects/spring-security/releases/tag/7.0.0-M3[Spring Security 7.0.0-M3]

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

* https://github.com/ehcache/ehcache3/releases/tag/v3.11.1[Ehcache3 3.11.1]
* https://documentation.red-gate.com/flyway/release-notes-and-older-versions/release-notes-for-flyway-engine[Flyway 11.13.0]
* https://github.com/google/gson/releases/tag/gson-parent-2.13.2[Gson 2.13.2]
* https://github.com/HtmlUnit/htmlunit/releases/tag/4.16.0[HtmlUnit 4.16.0]
* https://github.com/redis/jedis/releases/tag/v6.2.0[Jedis 6.2.0]
* https://downloads.apache.org/kafka/4.1.0/RELEASE_NOTES.html[Kafka 4.1.0]
* https://github.com/JetBrains/kotlin/releases/tag/v2.2.20[Kotlin 2.2.20]
* https://github.com/lettuce-io/lettuce-core/releases/tag/6.8.1.RELEASE[Lettuce 6.8.1.RELEASE]
* https://github.com/mongodb/mongo-java-driver/releases/tag/r5.6.0[MongoDB 5.6.0]
* https://github.com/open-telemetry/opentelemetry-java/releases/tag/v1.54.0[OpenTelemetry 1.54.0]
* https://pulsar.apache.org/release-notes/versioned/pulsar-4.1.0[Pulsar 4.1.0]
* SnakeYAML 2.5



=== Miscellaneous

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

* 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.


== Deprecations in Spring Boot 4.0.0-M3

* None
