java

Spring Boot 2.7.0 New Features

Spring Boot version 2.7.0 is released with new features and many updates. In this tutorial, we are going to explore the features of Spring Boot 2.7.0.

Below are the major changes in 2.7.0:

Version 2.1 of the H2 database:
Spring Boot 2.7 has been upgraded to H2 2.1.120 . H2 2.x is backward incompatible and fixes many security vulnerabilities.

Cache2k:
Spring Boot 2.7.0 supports dependency management and auto-configuration for Cache2k. In Spring Boot the support for Cache2k started with Spring 5 and Spring Boot 2. Spring Boot 2.7 now supports Spring GraphQL with the corresponding starter “spring-boot-starter-graphql”.

ElasticSearch and CouchBase:

Spring Boot 2.7.0 also provides new test annotations for ElasticSearch(@DataElasticsearchTest) and CouchBase(@DataCouchbaseTest). Now developers can use these annotations during development of applications.

Spring GraphQL Support:
Spring Boot 2.7 now supports Spring GraphQL with the corresponding starter spring-boot-starter-graphql. GraphQL is a query language for APIs and also a language that can cater to data queries.

Podman support:
Maven and Gradle plugins now support using the Podman container engine as an alternative to the Docker engine when building images with Cloud Native Buildpacks.

Jackson Mixin Simplified Registration:
Jackson’s autoconfiguration will now scan your application package for Mixin classes with the @JsonMixin annotation and register them to the ObjectMapper.

Opaque token introspection optimization:
If you use opaque token introspection in the OAuth2 resource server, the automatically configured introspection no longer requires a dependency on com.nimbusds:oauth2-oidc-sdk. You are able to remove this dependency from the application.

OkHttp 4:
As OkHttp 3 is no longer maintained, Spring Boot 2.7 has been upgraded to OkHTTP 4. As part of this upgrade, the property used to control the version of OkHttp has been changed from okhttp3.version to okhttp.version. If you wish to use OkHttp 3, please change to the corresponding version.

/actuator/info related features:
JavaInfoContributor and OsInfoContributor classes have been improved and can now expose more information about :

  • Java version & vendor
  • Underlying OS

@SpringBootTest configuration item priority:
Test properties that you can now add via the properties property of @SpringBootTest or the @TestPropertySource annotation have a higher priority than properties passed to args via the command line.

Dependency Updates:

  • Spring Data 2021.2
  • Spring Security 5.7
  • Infinispan 13
  • Micrometer 1.9
  • Elasticsearch 7.17
  • H2 2.1
  • Flyway 8.5

Based on Spring Framework 6.0, Spring Boot 3.0 will be the next major revision and will require Java 17 or above.

Loading

Translate »