:reference-docs: https://docs.spring.io/spring-boot/3.4-SNAPSHOT/reference
:maven-docs: https://docs.spring.io/spring-boot/3.4-SNAPSHOT/maven-plugin
:gradle-docs: https://docs.spring.io/spring-boot/3.4-SNAPSHOT/gradle-plugin

= Spring Boot 3.4.0-M1 Release Notes



== Upgrading from Spring Boot 3.3



=== Bean Validation of Configuration Properties
Previously, when a `@ConfigurationProperties` class annotated with `@Validated` was being validated using a Bean Validation implementation such as Hibernate Validator, validation of nested properties would be performed as they were bound, irrespective of the use of `@Valid`.
In Spring Boot 3.4, validation now follows the behavior of the Bean Validation specification.
Validation is performed from the `@ConfigurationProperties`-annoated class and only cascades down to nested properties where the corresponding field is annotated with `@Valid`.

When upgrading, inspect your `@ConfigurationProperties` classes with Bean Validation constraints.
Add `@Valid` as necessary where you want the validation to cascade down to nested properties.



=== HtmlUnit 4.3
HtmlUnit has been upgraded to 4.3.
With this upgrade comes a change in dependency coordinates from `net.sourceforge.htmlunit:htmlunit` to `org.htmlunit:htmlunit` and a change in package names from `com.gargoylesoftware.htmlunit.*` to `org.htmlunit.*`. When upgrading, update your build configuration and imports accordingly.



=== Selenium HtmlUnit 4.22
Selenium HtmlUnit has been updated to 4.22.
With this upgrade comes a change in dependency coordinates from `org.seleniumhq.selenium:htmlunit-driver` to `org.seleniumhq.selenium:htmlunit3-driver`. When upgrading, update your build configuration accordingly.



=== Paketo tiny Builder for Building OCI Images
The default Cloud Native Buildpacks builder used when building OCI images for JVM applications using the Maven `spring-boot:build-image` goal or Gradle `bootBuildImage` task has changed from `paketobuildpacks/builder-jammy-base` to `paketobuildpacks/builder-jammy-tiny`. 
This should result in smaller images. 
The `tiny` builder does not include a shell, so it might not work for applications that require a start script to run the application. 
See the {maven-docs}/build-image.html#build-image.examples.builder-configuration[Maven] or {gradle-docs}/packaging-oci-image.html#build-image.examples.builder-configuration[Gradle] documentation for information on customizing the builder. 


=== WebJars Locator Integration

https://github.com/spring-projects/spring-framework/issues/27619[For faster startup times and efficient WebJars asset resolution], you will need to update your pom.xml/build.gradle to depend on `org.webjars:webjars-locator-lite` instead of `org.webjars:webjars-locator-core` (both dependencies are managed by Spring Boot). Note that `org.webjars:webjars-locator-core` support in Spring is now deprecated and will be removed in a future version. https://docs.spring.io/spring-boot/3.4/reference/web/servlet.html#web.servlet.spring-mvc.static-content[See the reference documentation section on this feature.]




=== Deprecations from Spring Boot 3.2
Classes, methods, and properties that were deprecated in Spring Boot 3.2 and marked for removal in 3.4 have been removed in this release. Please ensure that you aren’t calling deprecated methods before upgrading.



=== Minimum Requirements Changes



==== Gradle
Gradle 7.5, 8.0, 8.1, and 8.2 are no longer supported. Gradle 7.x (7.6.4 or later) or Gradle 8.x (8.3 or later) is now required.



== New and Noteworthy
TIP: Check link:Spring-Boot-3.4.0-M1-Configuration-Changelog[the configuration changelog] for a complete overview of the changes in configuration.



=== Structured Logging
Support for structured logging has been introduced with built-in support for Elastic Common Schema (`ecs`) and Logstash (`logstash`) formats.
To enable structured file logging set `logging.structured.format.file` to `ecs` or `logstash`.
Similarly, to enable structured console logging set `logging.structured.format.console`.

To learn more about Spring Boot's support for structured logging, including how to define a custom format, see the {reference-docs}/features/logging.html#features.logging.structured[reference documentation].



=== Observability Improvements
The new property `spring.application.group` can be used to group applications together, for example if they all belong to some business unit or one bigger application arrangement. 
When this property is set, it's also included in the log messages. 
This behavior can be controlled with the property `logging.include-application.group`. 
The application group is also automatically added to the OpenTelemetry `Resource`.

The new properties `management.otlp.tracing.export.enabled`, `management.wavefront.tracing.export.enabled` and `management.zipkin.tracing.export.enabled` can be used to enable or disable trace exporting more finely grained.

The new properties under `management.otlp.logs` can be used to auto-configure OpenTelemetry's `OtlpHttpLogRecordExporter` and `SdkLoggerProvider`.

The `ProcessInfoContributor` now also shows memory info about heap and non-heap usage.



=== AssertJ Support for MockMvc
Auto-configuration for `MockMvcTester` is provided when AssertJ is on the classpath.
`MockMvcTester` lets you define the requests and the assertions using a fluent API.
It can be injected anywhere `MockMvc` is.

For more details, check https://docs.spring.io/spring-framework/reference/6.2-SNAPSHOT/testing/mockmvc/assertj.html[the dedicated section] of the Spring Framework reference documentation.



=== Docker Compose Improvements



==== Command Line Arguments
The new properties `spring.docker.compose.start.arguments` and `spring.docker.compose.stop.arguments` can be used to specify additional command line arguments that are passed to Docker Compose when starting and stopping services.



==== PostgreSQL
The https://github.com/docker-library/docs/tree/657557822ecebebf0fa6bea96536125881c5bfb2/postgres#postgres_host_auth_method[`POSTGRES_HOST_AUTH_METHOD=trust` environment variable] is now supported.



==== Redis
Support for Redis Stack and Redis Stack Server has been added using the `redis/redis-stack` and `redis/redis-stack-server` container images respectively.



=== Testcontainers Improvements



==== Kafka
`org.testcontainers.kafka.KafkaContainer` is now supported.



==== Redis
Support for Redis Stack and Redis Stack Server has been added using the `redis/redis-stack` and `redis/redis-stack-server` container images respectively.


=== Image Building Improvements
A `trustBuilder` option has been added to the Maven and Gradle plugins for building OCI images. 
This option controls how the CNB lifecycle is invoked, providing improved security when using builders from untrusted sources. 
By default, builders from the Paketo project, Heroku, and Google are trusted. 
See the {maven-docs}/build-image.html#build-image.customization[Maven] or {gradle-docs}/packaging-oci-image.html#build-image.customization[Gradle] documentation for information. 



=== Dependency Upgrades
Spring Boot 3.4.0-M1 moves to new versions of several Spring projects:

* https://github.com/micrometer-metrics/micrometer/releases/tag/v1.14.0-M1[Micrometer 1.14.0-M1]
* https://github.com/micrometer-metrics/tracing/releases/tag/v1.4.0-M1[Micrometer Tracing 1.4.0-M1]
* https://github.com/reactor/reactor/releases/tag/2024.0.0-M4[Reactor 2024.0.0-M4]
* https://github.com/spring-projects/spring-amqp/releases/tag/v3.2.0-M1[Spring AMQP 3.2.0-M1]
* https://github.com/spring-projects/spring-framework/releases/tag/v6.2.0-M6[Spring Framework 6.2.0-M6]
* https://github.com/spring-projects/spring-integration/releases/tag/v6.4.0-M1[Spring Integration 6.4.0-M1]
* https://github.com/spring-projects/spring-kafka/releases/tag/v3.3.0-M1[Spring Kafka 3.3.0-M1]
* https://github.com/spring-projects/spring-security/releases/tag/6.4.0-M1[Spring Security 6.4.0-M1]
* https://github.com/spring-projects/spring-session/releases/tag/3.4.0-M1[Spring Session 3.4.0-M1]

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

* https://activemq.apache.org/components/artemis/download/release-notes-2.35.0[Artemis 2.35]
* https://github.com/assertj/assertj/releases/tag/assertj-build-3.26.0[AssertJ 3.26]
* https://commons.apache.org/proper/commons-codec/changes-report.html#a1.17.0[Commons Codec 1.17]
* https://documentation.red-gate.com/flyway/release-notes-and-older-versions/release-notes-for-flyway-engine[Flyway 10.15]
* https://github.com/google/gson/releases/tag/gson-parent-2.11.0[Gson 2.11]
* https://www.h2database.com/html/changelog.html[H2 2.3]
* https://github.com/HtmlUnit/htmlunit/releases/tag/4.3.0[HtmlUnit 4.3]
* https://docs.liquibase.com/start/release-notes/liquibase-release-notes/liquibase-4.28.0.html[Liquibase 4.28]
* https://mariadb.com/kb/en/mariadb-connector-j-3-4-0-release-notes/[MariaDB 3.4]
* https://github.com/mockito/mockito/releases/tag/v5.12.0[Mockito 5.12]
* https://dev.mysql.com/doc/relnotes/connector-j/en/news-9-0-0.html[MySQL 9.0]
* https://github.com/open-telemetry/opentelemetry-java/releases/tag/v1.39.0[OpenTelemetry 1.39]
* https://download.oracle.com/otn-pub/otn_software/jdbc/23c/JDBC-UCP-ReleaseNotes-23ai.txt[Oracle Database 23.4]
* https://raw.githubusercontent.com/rest-assured/rest-assured/master/changelog.txt[REST Assured 5.5]
* https://raw.githubusercontent.com/SeleniumHQ/selenium/selenium-4.22.0/java/CHANGELOG[Selenium 4.22]
* https://github.com/SeleniumHQ/htmlunit-driver/releases/tag/htmlunit3-driver-4.22.0[Selenium HtmlUnit 4.22]
* https://github.com/xmlunit/xmlunit/releases/tag/v2.10.0[XMLUnit 2.10]



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

* You can now use a `Customizer<Liquibase>` bean to customize Liquibase before it is being used
* The properties used to create a JCache `CacheManager` can now be customized by defining a `JCachePropertiesCustomizer` bean.
* The `RequestToViewNameTranslator` used by Spring MVC can now be customized by defining a bean named `viewNameTranslator`.
* Lettuce's `ClientOptions` can now be customized using a `LettuceClientOptionsBuilderCustomizer` bean.
  For broader configuration of the whole `LettuceClientConfiguration`, continue to use `LettuceClientConfigurationBuilderCustomizer`.
* The new customizer `ProxyConnectionFactoryCustomizer` can be used to customize a R2DBC `ProxyConnectionFactory`.
* An audit event is now published if a Spring Security logout happens.
* TLS on `JavaMailSender` can now be configured with SSL bundles using the new properties `spring.mail.ssl.*`
* GSON's strictness can be configured using the new `spring.gson.strictness` property.



== Deprecations in Spring Boot 3.4.0-M1

* `spring.gson.lenient` in favor of `spring.gson.strictness`.
* `@MockBean` and `@SpyBean` in favor of Spring Framework's `@MockitoBean` and `MockitoSpyBean` respectively.
