-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Spring Boot 3.5.0 Release Notes
The spring-boot-parent
module is no longer published.
It provides dependency management for internal dependencies used, for example, in Spring Boot’s own tests.
If you were using spring-boot-parent
, replace it with dependency management of your own that meets your application’s needs.
Supported values for .enabled
properties have been tightened with this release and are now more consistent.
Values must now be either true
or false
.
Previous versions of Spring Boot would sometimes use conditions that considered any value other than false
as enabled.
Rules for profile naming have been tightened with this release and are now more consistent.
Profiles can now only contain -
(dash), _
(underscore), letters and digits.
Additionally, Profiles are not allowed to start or end with -
or _
.
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.
Previously Spring Boot auto-configured 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:
@Configuration
public class MyConfiguration {
@Bean
static BeanFactoryPostProcessor taskExecutorAliasBeanFactoryPostProcessor() {
return (beanFactory) -> beanFactory.registerAlias("applicationTaskExecutor", "taskExecutor");
}
}
The spring.groovy.template.configuration.
properties have been deprecated in favor of new and existing spring.groovy.template.
properties. See the configuration changelog for further details.
When spring.data.redis.url
is configured, the Redis database that is used is determined by the URL.
If the URL does not specify a database, the default of 0
is used.
The spring.data.redis.database
property is now ignored when spring.data.redis.url
is configured, aligning its behavior with the host, port, username, and password properties.
Pushing metrics to a Prometheus Pushgateway now requires io.prometheus:prometheus-metrics-exporter-pushgateway
instead of io.prometheus:simpleclient_pushgateway
.
The new client’s Pushgateway support may also require a configuration change.
If you were using management.prometheus.metrics.export.pushgateway.base-url
, replace it with management.prometheus.metrics.export.pushgateway.address
and adjust the value to be in the form host:port
.
Three new properties have been added in support of the new Pushgateway client:
-
management.prometheus.metrics.export.pushgateway.format
-
management.prometheus.metrics.export.pushgateway.scheme
-
management.prometheus.metrics.export.pushgateway.token
Set the scheme
property to https
to use SSL when pushing metrics.
Set the token
property (instead of the existing username
and password
properties) to use token-based authentication.
Set the format
property to text
to push metrics as text rather than using protobuf.
The nativeTest
profile has been harmonized with native
to make it friendly for multi-module projects.
Native test execution will not occur unless the Spring Boot and Native Build tools plugin are defined in the project.
This is already the case for the native
profile.
See the documentation for more details.
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
Tip
|
Check the configuration changelog for a complete overview of the changes in configuration. |
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:
@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.
While it was already possible to load a single property from an environment variable, it’s now possible to load multiple properties from a single environment variable.
For example, the multi-line environment variable MY_CONFIGURATION
with this content:
my.var1=value1
my.var2=value2
can now be imported using the env:
prefix:
spring.config.import=env:MY_CONFIGURATION
After this, my.var1
and my.var2
are available in the Environment
.
This feature supports properties and yaml format. For more details, please see the documentation.
Stack Trace written to structured logs can now be customized to limit their size or print them in a different format.
You can use the logging.structured.json.stacktrace.*
properties to configure stack trace output.
For details, see the updated reference documentation.
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 the update reference documentation.
In addition to the new properties, the new ClientHttpConnectorBuilder
interface can be used for more complex customizations.
Client side SSL support has been added for selected service connections. This is supported for the following service connections:
-
Cassandra
-
Couchbase
-
Elasticsearch
-
Kafka
-
MongoDB
-
RabbitMQ
-
Redis
The Testcontainers and Docker Compose integrations have been updated to allow SSL configuration, too. For Testcontainers, you can use new annotations, for Docker Compose you’d use labels.
If a TaskDecorator
bean is present, it is applied to the auto-configured taskScheduler
bean.
It is also applied to the auto-configured ThreadPoolTaskSchedulerBuilder
and SimpleAsyncTaskSchedulerBuilder
beans.
It will be used by any schedulers created using those builders.
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.
Spring Boot now supports the OTEL_RESOURCE_ATTRIBUTES
and OTEL_SERVICE_NAME
environment variables.
Resource attributes configured through the configuration property taking precedence over those from the environment variables.
Additionally, support for the service.namespace
resource attribute has been added.
The value of this attribute is read from the spring.application.group
configuration property.
Support for the service.group
resource attribute has been deprecated and will be removed in a future release.
It’s now possible to define a custom BatchSpanProcessor
bean.
The span export can now be configured with newly added properties under the management.tracing.opentelemetry.export
prefix.
The JobParametersConverter
used by Spring Batch can now be customised by defining a bean of that type.
When no such bean is defined the DefaultJobParametersConverter
will be used as before.
The new spring.batch.jdbc.validate-transaction-state
property can be used to control whether transaction state is validated.
The default behavior is unchanged and transaction state will be validated.
When using the spring-boot-configuration-processor
, the META-INF/additional-spring-configuration-metadata.json
file can now be used to ignore properties:
{
"ignored": {
"properties": [
{
"name": "my.age"
}
]
}
}
This removes my.age
from the generated spring-configuration-metadata.json
file.
Additionally, the information that my.age
has been ignored is also recorded in the generated spring-configuration-metadata.json
file.
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.
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 bean background initialization out of the box.
Add support for configuring ReadFrom
using the spring.data.redis.lettuce.read-from
property.
The managed version of Liquibase is now 4.31.0. Two new Liquibase properties have been added:
-
spring.liquibase.analytics-enabled
– Whether to send product usage data and analytics to Liquibase -
spring.liquibase.license-key
– Liquibase Pro license key
Use of the properties requires Liquibase 4.31.0 or later.
Support for configuring a Vibur DBCP connection pool using DataSourceBuilder
has been added.
Dependency management has also been updated to cover org.vibur:vibur-dbcp
.
Containers using the lldap/lldap
image can now be used with Docker Compose and Testcontainers.
Testcontainers supports this image with LLdapContainer
.
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.
The Quartz Actuator endpoint can now be used to trigger Quartz jobs by sending an HTTP POST to the /actuator/quartz/jobs/{groupName}/{jobName}
URL.
See the updated REST documentation for an example.
Spring Boot Actuator now publishes metrics for SSL bundles.
The metric ssl.chains
counts the number of chains and their status (valid, expired, soon-to-be-expired, not-yet-valid).
The metric ssl.chain.expiry
tracks the number of seconds until expiry for each certificate chain.
The mappings endpoint now includes information about WebMvc.fn router functions. Consult the Actuator REST API documentation for details of the updated response structure.
Spring Boot 3.5 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:
-
Cassandra Driver 4.19
-
HikariCP 6.3
-
Oracle Database 23.7.0.25.01
-
SnakeYAML 2.4
-
WebJars Locator Lite 1.1
Apart from the changes listed above, there have also been lots of minor tweaks and improvements including:
-
The
application_name
property of the Postgres docker container is now configured by default usingspring.application.name
. -
The auto-configuration for Jackson retains modules that have been added prior to its execution, rather than overwriting them.
-
Tomcat connector’s max parameter count can be configured using the
server.tomcat.max-parameter-count
property. -
Actuator’s process info contributor now contains virtual thread information when running on JDK 24 or later.
-
The ECS structured logging format now adds Logback and Log4j’s markers in the
tags
field. -
Spring Boot now installs a Logback
OnErrorConsoleStatusListener
to print error messages during Logback initialization to the console. -
The 'error' entry returned from
ErrorAttributes
now wraps allMessageSourceResolvable
instances to ensure safe JSON serialization. -
Zipkin auto-configuration now uses
ZipkinHttpClientSender
by default, if theHttpClient
class is unavailableURLConnectionSender
is used. -
A new
@ConditionalOnBooleanProperty
annotation has been introduced. -
Empty passwords are now supported when using Bitnami’s PostgreSQL image with Docker Compose. Set
ALLOW_EMPTY_PASSWORD
in the container’s environment to enable the support. -
The new property
management.server.accesslog.prefix
can now be used to customize the access log prefix for the management server. -
The AWS Advanced JDBC Wrapper is now auto-detected from
jdbc:aws-wrapper:…
URLs, removing the need to configurespring.datasource.driver-class-name
. -
ConstraintViolation
s can be adapted to aMethodValidationResult
by setting the newspring.validation.method.adapt-constraint-violations
property totrue
-
If
io.micrometer:micrometer-java21
is on the classpath, aVirtualThreadsMetrics
bean is now auto-configured. -
The
java.home
system property is no longer used when running in native image. -
The new property
spring.jooq.config
can be used to specify an external jOOQsettings.xml
file or resource. -
New factory methods have been added to
SslManagerBundle
to create aSslManagerBundle
from aTrustManagerFactory
or from aTrustManager
. -
The
logging.structured.json.customizer
properties now accepts more than one customizer. -
A new
spring.r2dbc.pool.acquire-retry
property has been added. -
@ConditionalOnBean
now supports generic@Bean
return types. -
@ConditionalOnProperty
and@ConditionalOnBooleanProperty
are now@Repeatable
. -
Some unbindable properties with the prefixes
spring.datasource.dbcp2
,spring.datasource.hikari
,spring.datasource.oracleucp
andspring.datasource.tomcat
have been removed fromspring-configuration-metadata.json
. -
The new property
spring.mvc.contentnegotiation.default-content-types
can be used to configure default content types with Spring MVC. -
EndpointRequest
for both servlet and reactive stacks now supports matching on HTTP method. -
SanitizingFunction
now has convenience builder methods. SeeSanitizingFunction.sanitizeValue()
for an example. -
@ConfigurationPropertiesBinding
annotated@Bean
methods can now be implemented as lambdas. -
ApplicationConversionService
now detected generic types from converter@Bean
methods. -
A
CqlOperations
bean is now auto-configured and used internally byCassandraTemplate
. -
A
ReactiveCqlOperations
bean is now auto-configured and used internally byReactiveCassandraTemplate
. -
An
ObjectDirectoryMapper
bean is now auto-configured and used internally byLdapTemplate
. -
Renamed
management.server.accesslog.prefix
tomanagement.server.{server}.accesslog.prefix
where{server}
can bejetty
,tomcat
orundertow
. -
The property
spring.kafka.listener.auth-exception-retry-interval
has been added to configure the time between retries after authentication exceptions. -
Logging for Cloud Native Buildpacks integration has been improved.
-
The new property
spring.data.mongodb.protocol
has been added to allow the MongoDB protocol to be customized. -
Logback and Log4j2 now respect the console charset.
-
The transport-specific configuration properties for GraphQL have been reorganized.
spring.graphql.path
is nowspring.graphql.http.path
andspring.graphql.sse.timeout
is replaced byspring.graphql.http.sse.timeout
. -
Support for Zipkin’s
URLConnectionSender
has been removed. -
Removed the default value of
OtlpMetricsProperties.url
. However, this should lead to no visible changes as Micrometer then provides the default value. -
The auto-configured
JdbcTemplate
can be further customized using additional configuration properties forignoreWarnings
,skipResultsProcess
,skipUndeclaredResults
, andresultsMapCaseInsensitive
. -
In most cases, a
DataSource
can now be auto-configured withoutspring-jdbc
on the classpath.spring-jdbc
is still required to use an embedded database without a connection pool. -
The property
server.tomcat.use-apr
now defaults tonever
. If you want to use Tomcat’s APR, set the property towhen-available
oralways
. -
A
PollerMetadataCustomizer
has been added to customize Spring Integration’sPollerMetadata
. -
Garbage collector information has been added to the actuator process info.
-
Removed the readonly flag from the
BuildImage
Maven mojo to remove Maven warnings. -
The
SameSite
attribute can be omitted from the session cookie by settingserver.servlet.session.cookie.same-site
orserver.reactive.session.cookie.same-site
toomitted
. -
MeterProvider
beans are now automatically configured onOtlpHttpLogRecordExporter
,OtlpHttpSpanExporter
,OtlpGrpcLogRecordExporter
andOtlpGrpcSpanExporter
. -
The
referral
mode for Spring LDAP can be configured with the newspring.ldap.referral
property. -
Customizers for
OtlpHttpSpanExporterBuilder
andOtlpGrpcSpanExporterBuilder
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 fromHttpClientProperties
. -
RestClientAutoConfiguration
now applies for reactive web applications that are using virtual threads and have aapplicationTaskExecutor
bean. -
The Auto-configured
OtlpMeterRegistry
now applies any use providedOtlpMetricsSender
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 tofalse
if you don’t want the details printed when tests fail.
-
ConditionalOutcome.inverse(…)
has been deprecated for removal since it doesn’t generate a useful message -
Support for SignalFX has been deprecated, following the deprecation in Micrometer.
-
org.springframework.boot.autoconfigure.security.servlet.RequestMatcherProvider
has been deprecated to move it toorg.springframework.boot.actuate.autoconfigure.security.servlet.RequestMatcherProvider
. -
org.springframework.boot.autoconfigure.security.oauth2.client.ClientsConfiguredCondition
in favor of@org.springframework.boot.autoconfigure.security.oauth2.client.ConditionalOnOAuth2ClientRegistrationProperties
. -
org.springframework.boot.autoconfigure.security.oauth2.resource.IssuerUriCondition
in favor of@org.springframework.boot.autoconfigure.security.oauth2.resource.ConditionalOnIssuerLocationJwtDecoder
. -
org.springframework.boot.autoconfigure.security.oauth2.resource.KeyValueCondition
in favor of@org.springframework.boot.autoconfigure.security.oauth2.resource.ConditionalOnPublicKeyJwtDecoder
. -
org.springframework.boot.devtools.autoconfigure.OnEnabledDevToolsCondition
in favor of@org.springframework.boot.devtools.autoconfigure.ConditionalOnEnabledDevTools
. -
The configuration property
spring.mvc.converters.preferred-json-mapper
has been deprecated. It is replaced byspring.http.converters.preferred-json-mapper
. -
The configuration properties
spring.codec.log-request-details
andspring.codec.max-in-memory-size
have been deprecated. They are replaced byspring.http.codecs.log-request-details
andspring.http.codecs.max-in-memory-size
respectively. -
org.springframework.boot.autoconfigure.security.oauth2.client.servlet.OAuth2ClientAutoConfiguration
in favor oforg.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration
. -
org.springframework.boot.logging.LoggingSystemProperties.getDefaultCharset()
in favor ofgetDefaultConsoleCharset()
orgetDefaultFileCharset()
. -
ThreadPoolTaskSchedulerBuilder
multi-parameter based constructor in favor of the default constructor. -
org.springframework.boot.autoconfigure.condition.ConditionOutcome.inverse(ConditionOutcome)` in favor of creating a new
ConditionOutcome
. -
KafkaConnectionDetails…BootstrapServers
methods in favor of using chained method calls. -
The
ConnectionDetailsFactories
default constructor in favor for a version that accepts a class loader. -
OnEnabledDevToolsCondition
in favor of the@ConditionalOnEnabledDevTools
annotation.