Skip to content

Spring Boot 2.7.0 M2 Release Notes

Andy Wilkinson edited this page Feb 24, 2022 · 37 revisions

Spring Boot 2.7.0 M2 Release Notes

Upgrading from Spring Boot 2.6

OkHttp 4

As OkHttp 3 is no longer being maintained, Spring Boot 2.7 has upgraded to OkHTTP 4. As part of this upgrade, the property used to control OkHttp’s version has changed from okhttp3.version to okhttp.version.

OkHttp 4 is intended to be backwards compatible with OkHttp 3. If this is not the case in your application or wish to continue using OkHttp 3 for another reason, configure the okttp.version property in your build.

Separate Dependency Management for netty-tcnative Removed

Separate dependency management for netty-tcnative has been removed in favor of the dependency management provided by Netty’s bom. This ensures that the version of netty-tcnative will align with the version that Netty uses by default. As a result of this change, the netty-tcnative.version property can no longer be used to override the version of netty-tcnative. The version can still be overridden by providing your own dependency management but it is recommended that it remains aligned with Netty’s default version.

Deprecations from Spring Boot 2.5

Minimum Requirements Changes

New and Noteworthy

Tip
Check the configuration changelog for a complete overview of the changes in configuration.

Opaque Token Introspection Without the OIDC SDK

If you are using opaque token introspection in your OAuth2 resource server, the auto-configured introspector no longer requires a dependency on com.nimbusds:oauth2-oidc-sdk. Depending on other usages of the SDK, you may be able to remove the dependency from your application.

Changes to Auto-configuration

Auto-configuration Registration

If you have created your own auto-configurations, you should move the registration from spring.factories to a new file named META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports. Each line contains the fully qualified name of the auto-configuration. See the included auto-configurations for an example.

For backwards compatibility, entries in spring.factories will still be honored.

New @AutoConfiguration Annotation

A new @AutoConfiguration annotation has been introduced. It should be used to annotate top-level auto-configuration classes that are listed in the new META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports file, replacing @Configuration. Configuration classes that are nested within or imported by an @AutoConfiguration class should continue to use @Configuration as before.

For your convenience, @AutoConfiguration also supports auto-configuration ordering via the after, afterNames, before and beforeNames attributes. This can be used as a replacement for @AutoConfigureAfter and @AutoConfigureBefore.

Test slice configuration

If you have created your own test-slices, you should move the registration from spring.factories to the new place under META-INF/spring/<name of your test slice annotation>.imports. The format is the same as the new file described in the "Auto-configuration location" section, see above.

Redis Sentinel username support

Support for specifying a username for authenticating to Sentinel(s) has been added using the spring.redis.sentinel.username property.

Dependency Upgrades

Spring Boot 2.7.0-M2 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:

  • OkHTTP 4.9

Miscellaneous

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

  • The InputStream returned by RandomAccessDataFile in spring-boot-loader now implements available().

Deprecations in Spring Boot 2.7

  • Loading auto-configurations from spring.factories is deprecated. See above for more details.

Clone this wiki locally