-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Spring Boot 3.5 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.
The heapdump actuator endpoint now defaults to access=NONE.
The aims to help reduce the likelihood of a misconfiguration application leaking sensitive information.
If you want to use it, you now need to both expose it, and configure access (previously, you only needed to expose it).
To do that, you can use something similar to following configuration:
management:
endpoints:
web:
exposure:
include: heapdump
endpoint:
heapdump:
access: unrestrictedSupported 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 _.
|
Note
|
As of Spring Boot 3.5.1 these restrictions have been relaxed a little to also allow ., + and @ characters.
You can also set spring.profiles.validate to false to disable validation entirely.
|
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.
The default version of the Apache Pulsar client has been upgraded from 3.3.x to 4.0.x. This upgrade was made to align with the Apache Pulsar release policy. 3.3.x has now reached end-of-life and 4.0.x is a new LTS release.
Due to changes in Spring Boot’s support for configuring Couchbase to use SSL, Couchbase Capella’s embedded certificate will no longer be picked up automatically. If you are using Capella and want to trust its embedded certificate, create an SSL bundle with a truststore that references the certificate and configure Couchbase to use it:
spring:
ssl:
bundle:
pem:
couchbase-bundle:
truststore:
# Note that this certificate is fetched from the `com.couchbase.client:code-io` dependency.
certificate: classpath:com/couchbase/client/core/env/capella-ca.pem
couchbase:
env:
ssl:
bundle: couchbase-bundleClasses, methods, and properties that were deprecated in Spring Boot 3.3 and marked for removal in 3.5 have been removed in this release. Please ensure that you aren’t calling deprecated methods or otherwise using deprecated functionality before upgrading.
|
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=value2can now be imported using the env: prefix:
spring.config.import=env:MY_CONFIGURATIONAfter 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. As a result, some default behavior as changed to be aligned with the blocking clients; for example, follow redirects are now enabled by default.
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 take 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.
-
OAuth2ClientAutoConfigurationconfigure OAuth 2 client related beans in anything other than a reactive web application. -
OAuth2ClientWebSecurityAutoConfigurationconfigures OAuth 2 client based web security in a servlet web application. -
ReactiveOAuth2ClientAutoConfigurationconfigures reactive OAuth 2 client related beans in anything other than a servlet web application. -
ReactiveOAuth2ClientWebSecurityAutoConfigurationconfigures 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_nameproperty 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-countproperty. -
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
tagsfield. -
Spring Boot now installs a Logback
OnErrorConsoleStatusListenerto print error messages during Logback initialization to the console. -
The 'errors' entry returned from
ErrorAttributesnow includes errors fromMethodValidationResult. Errors may be wrapped to ensure that they can be safely serialised to JSON. -
Zipkin auto-configuration now uses
ZipkinHttpClientSenderby default, if theHttpClientclass is unavailableURLConnectionSenderis used. -
A new
@ConditionalOnBooleanPropertyannotation has been introduced. -
Empty passwords are now supported when using Bitnami’s PostgreSQL image with Docker Compose. Set
ALLOW_EMPTY_PASSWORDin the container’s environment to enable the support. -
The new property
management.server.accesslog.prefixcan 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. -
ConstraintViolations can be adapted to aMethodValidationResultby setting the newspring.validation.method.adapt-constraint-violationsproperty totrue -
If
io.micrometer:micrometer-java21is on the classpath, aVirtualThreadsMetricsbean is now auto-configured. -
The
java.homesystem property is no longer used when running in native image. -
The new property
spring.jooq.configcan be used to specify an external jOOQsettings.xmlfile or resource. -
New factory methods have been added to
SslManagerBundleto create aSslManagerBundlefrom aTrustManagerFactoryor from aTrustManager. -
The
logging.structured.json.customizerproperties now accepts more than one customizer. -
A new
spring.r2dbc.pool.acquire-retryproperty has been added. -
@ConditionalOnBeanand@ConditionalOnMissingBeannow support generic@Beanreturn types. -
@ConditionalOnPropertyand@ConditionalOnBooleanPropertyare now@Repeatable. -
Some unbindable properties with the prefixes
spring.datasource.dbcp2,spring.datasource.hikari,spring.datasource.oracleucpandspring.datasource.tomcathave been removed fromspring-configuration-metadata.json. -
The new property
spring.mvc.contentnegotiation.default-content-typescan be used to configure default content types with Spring MVC. -
EndpointRequestfor both servlet and reactive stacks now supports matching on HTTP method. -
SanitizingFunctionnow has convenience builder methods. SeeSanitizingFunction.sanitizeValue()for an example. -
@ConfigurationPropertiesBindingannotated@Beanmethods can now be implemented as lambdas. -
ApplicationConversionServicenow detected generic types from converter@Beanmethods. -
A
CqlOperationsbean is now auto-configured and used internally byCassandraTemplate. -
A
ReactiveCqlOperationsbean is now auto-configured and used internally byReactiveCassandraTemplate. -
An
ObjectDirectoryMapperbean is now auto-configured and used internally byLdapTemplate. -
Renamed
management.server.accesslog.prefixtomanagement.server.{server}.accesslog.prefixwhere{server}can bejetty,tomcatorundertow. -
The
micrometer.observations.annotations.enabledconfiguration property was deprecated in 3.2.x in favor ofmanagement.observations.annotations.enabled. Support for the former has been removed entirely. -
The property
spring.kafka.listener.auth-exception-retry-intervalhas 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.protocolhas 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.pathis nowspring.graphql.http.pathandspring.graphql.sse.timeoutis replaced byspring.graphql.http.sse.timeout. -
Support for Zipkin’s
URLConnectionSenderhas 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
JdbcTemplatecan be further customized using additional configuration properties forignoreWarnings,skipResultsProcess,skipUndeclaredResults, andresultsMapCaseInsensitive. -
In most cases, a
DataSourcecan now be auto-configured withoutspring-jdbcon the classpath.spring-jdbcis still required to use an embedded database without a connection pool. -
The property
server.tomcat.use-aprnow defaults tonever. If you want to use Tomcat’s APR, set the property towhen-availableoralways. -
A
PollerMetadataCustomizerhas been added to customize Spring Integration’sPollerMetadata. -
Garbage collector information has been added to the actuator process info.
-
Removed the readonly flag from the
BuildImageMaven mojo to remove Maven warnings. -
The
SameSiteattribute can be omitted from the session cookie by settingserver.servlet.session.cookie.same-siteorserver.reactive.session.cookie.same-sitetoomitted. -
MeterProviderbeans are now automatically configured onOtlpHttpLogRecordExporter,OtlpHttpSpanExporter,OtlpGrpcLogRecordExporterandOtlpGrpcSpanExporter. -
The
referralmode for Spring LDAP can be configured with the newspring.ldap.referralproperty. -
Customizers for
OtlpHttpSpanExporterBuilderandOtlpGrpcSpanExporterBuilderhave been added. -
The new property
spring.kafka.consumer.max-poll-intervalcan be used to configure Kafka’s maximum delay between poll invocations. -
RECORD_COMPONENThas been removed as a target from@DefaultValue, as it wasn’t really necessary. -
The auto-configured
RestClientSslbean now builds upon, rather than overwrite, the configuration fromHttpClientProperties. -
RestClientAutoConfigurationnow applies for reactive web applications that are using virtual threads and have aapplicationTaskExecutorbean. -
The Auto-configured
OtlpMeterRegistrynow applies any use providedOtlpMetricsSenderbean. -
It is now possible to set histogram-flavor and max-buckets per meter registry.
-
Additional properties have been added under
logging.structured.json.contextto allow context data to not be logged, or to be logged in a different location. -
A new
spring.test.print-condition-evaluation-reportproperty has been added that can be set tofalseif 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.RequestMatcherProviderhas been deprecated to move it toorg.springframework.boot.actuate.autoconfigure.security.servlet.RequestMatcherProvider. -
org.springframework.boot.autoconfigure.security.oauth2.client.ClientsConfiguredConditionin favor of@org.springframework.boot.autoconfigure.security.oauth2.client.ConditionalOnOAuth2ClientRegistrationProperties. -
org.springframework.boot.autoconfigure.security.oauth2.resource.IssuerUriConditionin favor of@org.springframework.boot.autoconfigure.security.oauth2.resource.ConditionalOnIssuerLocationJwtDecoder. -
org.springframework.boot.autoconfigure.security.oauth2.resource.KeyValueConditionin favor of@org.springframework.boot.autoconfigure.security.oauth2.resource.ConditionalOnPublicKeyJwtDecoder. -
org.springframework.boot.devtools.autoconfigure.OnEnabledDevToolsConditionin favor of@org.springframework.boot.devtools.autoconfigure.ConditionalOnEnabledDevTools. -
The configuration property
spring.mvc.converters.preferred-json-mapperhas been deprecated. It is replaced byspring.http.converters.preferred-json-mapper. -
The configuration properties
spring.codec.log-request-detailsandspring.codec.max-in-memory-sizehave been deprecated. They are replaced byspring.http.codecs.log-request-detailsandspring.http.codecs.max-in-memory-sizerespectively. -
org.springframework.boot.autoconfigure.security.oauth2.client.servlet.OAuth2ClientAutoConfigurationin favor oforg.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration. -
org.springframework.boot.logging.LoggingSystemProperties.getDefaultCharset()in favor ofgetDefaultConsoleCharset()orgetDefaultFileCharset(). -
ThreadPoolTaskSchedulerBuildermulti-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…BootstrapServersmethods in favor of using chained method calls. -
The
ConnectionDetailsFactoriesdefault constructor in favor for a version that accepts a class loader. -
OnEnabledDevToolsConditionin favor of the@ConditionalOnEnabledDevToolsannotation.