:boot-docs: https://docs.spring.io/spring-boot/3.5

= Spring Boot 3.5.0-RC1 Release Notes



== Upgrading from Spring Boot 3.4


=== Auto-configured TaskExecutor Names

Thus far, Spring Boot auto-configures a `TaskExecutor` with the `taskExecutor` and `applicationTaskExecutor` bean names.
As of this release, only the `applicationTaskExecutor` bean name is provided.
Code that is requesting the auto-configured  `Executor` by name should be adapted to use `applicationTaskExecutor`.

If you relied on this behaviour and cannot change it immediately, the alias can be added using a `BeanFactoryPostProcessor`, as shown in the following example:

[source,java]
----
@Configuration
public class MyConfiguration {

    @Bean
    static BeanFactoryPostProcessor taskExecutorAliasBeanFactoryPostProcessor() {
        return (beanFactory) -> beanFactory.registerAlias("applicationTaskExecutor", "taskExecutor");
    }

}
----


=== ECS Structured Logging JSON

JSON output for ECS structure logging has been updated to use the nested format.
This should improve compatibility with the backends that consume the JSON.

See https://github.com/spring-projects/spring-boot/issues/45063 for background



=== Follow Redirects with TestRestTemplate

The `TestRestTemplate` now uses the same follow redirects settings as the regular `RestTemplate`.
The `HttpOption.ENABLE_REDIRECTS` option has also been deprecated.

If the new default settings causes issues with your tests, you can use the `TestRestTemplate.withRedirects(...)` method to pick an alternative follow redirects strategy.



=== Minimum Requirements Changes

None.



== New and Noteworthy

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



=== AsyncTaskExecutor with Custom Executor

If an `Executor` bean is present, Spring Boot can now be configured to auto-configure an `AsyncTaskExecutor` anyway.
To do so, set the `spring.task.execution.mode` property to `force`.

When running in this mode, it makes sure that all integrations, including regular `@Async` processing uses the auto-configured executor,
unless an `AsyncConfigurer` bean is defined.


=== Auto-configuration for Bean Background Initialization

Spring Boot now auto-configures a bean named `bootstrapExecutor` if it's not already there.
For that to work, there needs to be a bean named `applicationTaskExecutor` in the context, which is the default if you haven't defined a custom `Executor` bean.
This enables https://docs.spring.io/spring-framework/reference/core/beans/java/composing-configuration-classes.html#beans-java-startup-background[bean background initialization] out of the box.



=== ClientHttpConnector Builder and Configuration Properties

Users of `WebClient` can now use properties for global configuration such as timeouts and redirect settings.
This feature aligns with the support that we added for blocking clients in Spring Boot 3.4.

For details, see {boot-docs}/reference/io/rest-client.html#io.rest-client.webclient.configuration[the update reference documentation].

In addition to the new properties, the new `ClientHttpConnectorBuilder` interface can be used for more complex customizations.



=== Annotations to Register `Filter` and `Servlet`

As an annotation-based alternative to `ServletRegistrationBean` and `FilterRegistrationBean` two new annotations have been added.
`@ServletRegistration` can be used to register `Servlet`, while `@FilterRegistration` can be used to register `Filter`, as shown in this example:

[source,java]
----
@Configuration(proxyBeanMethods = false)
class MyConfiguration {

    @Bean
    @FilterRegistration(name = "my-filter", urlPatterns = "/test/*", order = 0)
    MyFilter myFilter() {
        return new MyFilter();
    }

}
----

Additionally, the behavior of `FilterRegistrationBean` for empty dispatcher types has been adjusted.
Previously, it was possible to pass an empty `DispatcherType` set into the `setDispatcherTypes` methods, and this empty set would be passed through to the server. Now it's the same behavior as calling `setDispatcherTypes(null)`, which aligns it to the `FilterRegistration` annotation.



=== OAuth 2 Client Auto-configuration

OAuth 2 Client auto-configuration now applies in more situations and is more granular.

- `OAuth2ClientAutoConfiguration` configure OAuth 2 client related beans in anything other than a reactive web application
- `OAuth2ClientWebSecurityAutoConfiguration` configures OAuth 2 client based web security in a servlet web application
- `ReactiveOAuth2ClientAutoConfiguration` configures reactive OAuth 2 client related beans in anything other than a servlet web application
- `ReactiveOAuth2ClientWebSecurityAutoConfiguration` configures OAuth 2 client based web security in a reactive web application


=== Cloud Native Buildpacks



==== Ubuntu Noble

The default builder has been switched to `paketobuildpacks/builder-noble-java-tiny`.
The resulting image doesn't have a shell or other utilities.
If you need a shell, you can use `paketobuildpacks/ubuntu-noble-run-base` as the run image.



==== Docker Config Authentication 

Both the Maven and Gradle plugin will now attempt to use authentication settings from your docker `config.json` file.
This includes support for executing credential helpers to support things like the MacOS keychain.



=== Dependency Upgrades

Spring Boot 3.5.0-RC1 moves to new versions of several Spring projects:

- https://github.com/micrometer-metrics/micrometer/releases/tag/v1.15.0-RC1[Micrometer 1.15.0-RC1]
- https://github.com/micrometer-metrics/tracing/releases/tag/v1.5.0-RC1[Micrometer Tracing 1.5.0-RC1]
- https://github.com/spring-projects/spring-authorization-server/releases/tag/1.5.0-RC1[Spring Authorization Server 1.5.0-RC1]
- https://github.com/spring-projects/spring-data-bom/releases/tag/2025.0.0-RC1[Spring Data 2025.0.0-RC1]
- https://github.com/spring-projects/spring-graphql/releases/tag/v1.4.0-RC1[Spring GraphQL 1.4.0-RC1]
- https://github.com/spring-projects/spring-hateoas/releases/tag/2.5.0-RC1[Spring HATEOAS 2.5.0-RC1]
- https://github.com/spring-projects/spring-integration/releases/tag/v6.5.0-RC1[Spring Integration 6.5.0-RC1]
- https://github.com/spring-projects/spring-ldap/releases/tag/3.3.0-RC1[Spring LDAP 3.3.0-RC1]
- https://github.com/spring-projects/spring-security/releases/tag/6.5.0-RC1[Spring Security 6.5.0-RC1]
- https://github.com/spring-projects/spring-session/releases/tag/3.5.0-RC1[Spring Session 3.5.0-RC1]

- https://github.com/spring-projects/spring-ws/releases/tag/v4.1.0-RC1[Spring WS 4.1.0-RC1]

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

- https://documentation.red-gate.com/flyway/release-notes-and-older-versions/release-notes-for-flyway-engine[Flyway 11.7]
- https://github.com/graphql-java/graphql-java/releases/tag/v23.1[GraphQL Java 23.1]
- HikariCP 6.3
- https://github.com/influxdata/influxdb-java/releases/tag/influxdb-java-2.25[InfluxDB Java 2.25]
- https://github.com/mockito/mockito/releases/tag/v5.17.0[Mockito 5.17]
- https://github.com/mongodb/mongo-java-driver/releases/tag/r5.4.0[MongoDB 5.4]
- https://github.com/open-telemetry/opentelemetry-java/releases/tag/v1.49.0[OpenTelemetry 1.49]
- https://github.com/apache/pulsar-client-reactive/releases/tag/v0.6.0[Pulsar Reactive 0.6.0]
- https://github.com/rabbitmq/rabbitmq-stream-java-client/releases/tag/v0.23.0[Rabbit Stream Client 0.23]
- https://github.com/SeleniumHQ/selenium/releases/tag/selenium-4.31.0[Selenium 4.31]
- https://github.com/SeleniumHQ/htmlunit-driver/releases/tag/htmlunit-driver-4.30.0[Selenuium HtmlUnit 4.30]
- https://github.com/testcontainers/testcontainers-java/releases/tag/1.21.0[Testcontainers 1.21]



=== Miscellaneous

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

* `MeterProvider` beans are now automatically configured on `OtlpHttpLogRecordExporter`, `OtlpHttpSpanExporter`, `OtlpGrpcLogRecordExporter` and `OtlpGrpcSpanExporter`.
* The `referral` mode for Spring LDAP can be configured with the new `spring.ldap.referral` property.
* Customizers for `OtlpHttpSpanExporterBuilder` and `OtlpGrpcSpanExporterBuilder` have been added.
* The new property `spring.kafka.consumer.max-poll-interval` can be used to configure Kafka's maximum delay between poll invocations.
* `RECORD_COMPONENT` has been removed as a target from `@DefaultValue`, as it wasn't really necessary.
* The auto-configured `RestClientSsl` bean now builds upon, rather than overwrite, the configuration from `HttpClientProperties`.
* `RestClientAutoConfiguration` now applies for reactive web applications that are using virtual threads and have a `applicationTaskExecutor` bean.
* The Auto-configured `OtlpMeterRegistry` now applies any use provided `OtlpMetricsSender` bean.
* It is now possible to set histogram-flavor and max-buckets per meter registry.
* Additional properties have been added under `logging.structured.json.context` to allow context data to not be logged, or to be logged in a different location.
* A new `spring.test.print-condition-evaluation-report` property has been added that can be set to `false` if you don't want the details printed when tests fail.



== Deprecations in Spring Boot 3.5.0-RC1

* The configuration property `spring.mvc.converters.preferred-json-mapper` has been deprecated. It is replaced by `spring.http.converters.preferred-json-mapper`.
* The configuration properties `spring.codec.log-request-details` and `spring.codec.max-in-memory-size` have been deprecated. They are replaced by `spring.http.codecs.log-request-details` and `spring.http.codecs.max-in-memory-size` respectively.
* `org.springframework.boot.autoconfigure.security.oauth2.client.servlet.OAuth2ClientAutoConfiguration` in favor of `org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration`
