🏠Spring BootSpring Boot Latest Version

Spring Boot Latest Version

As of May 21st of 2021, The latest stable spring boot version is 2.5.0. Spring Boot 2.5.0 offers a variety of new fixes and dependency updates. Let’s check them out in detail.

Information from start.spring.io

Java and Spring Boot version Compatibility

Spring Boot 2.5.0 requires at least Java 8. It is also tested with java 16.

Important dependency version updates

DependencyVersion
Spring Framework5.3.7
Embedded Tomcat Server9.0.46
Hibernate5.4.31.Final
HikariCP – Connection Pool4.0.3

What’s new in Spring Boot 2.5

Lets go through some noteworthy changes in Spring Boot version 2.5.0.

  1. Environment variable prefixes. By setting application.setEnvironmentPrefix("myapp"), you can use MYAPP_SERVER_PORT instead of SERVER_PORT.
  2. All embedded servers now support HTTP2 out of the box. To enable this, set server.http2.enabled=true
  3. Jetty 10 is available but can only work with Java 9. So the default version is still Jetty 9.

Things to consider while upgrading from version 2.4

Here are the things to consider while moving to spring boot 2.5.0.

  • The breaking change in the latest spring boot version is on the datasource initialization. The new SQL initialization doesn’t detect embedded databases. This means, the schema.sql and data.sql will apply to the primary data source regardless of whether it is embedded or not.
    • To avoid this, you should set the spring.sql.init.enabled to false.
    • Or, you could set the spring.datasource.initialization-mode to embedded to simulate old behaviour.
  • Also, data.sql will now run before hibernate initializes the schema. You should use spring.jpa.defer-datasource-initialization to true if you want to do it the other way.
  • The spring.flyway.url or spring.liquibase.url now requires you to use additional username and password properties.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

One Comment