Difference between Springboot 1.X and Springboot 2.X

We have been using Springboot 1.X in our applications and recently started coverting the existing code to use new springboot2.X version.
Moving to Spring Boot 2.X will upgrade a number of dependencies hence some of our code needs to be changed.

Below are the advantages or new features we came across,

1.Java 8 is minimum version

2.Tomcat 8.5 is minimum version

3.Hibernate 5.2 is minimum version

4.Gradle 3.4 is minimum version

5.Previously several Spring Boot starters were transitively depending on Spring MVC with spring-boot-starter-web. With the new support of Spring WebFlux, spring-boot-starter-mustache, spring-boot-starter-freemarker and spring-boot-starter-thymeleaf are not depending on it anymore. It is the developer’s responsibility to choose and add spring-boot-starter-web or spring-boot-starter-webflux.

6.Spring boot2.X initializr has dedicated auto-configuration to automatically configure the service.The behavior of the spring.config.location configuration has been fixed; it previously added a location to the list of default ones, now it replaces the default locations. If you were relying on the way it was handled previously, you should now use spring.config.additional-location instead.

7.Spring Security configuration become easier and Spring Security Oauth2 merges into Spring Security.The security auto-configuration no longer exposes options and uses Spring Security defaults as much as possible.

8.With Spring Boot 2.X, many configuration properties were renamed/removed and developers need to update their application.properties/application.yml accordingly.

9.Mockito 1.x is no longer supported. If you don’t use spring-boot-starter-test to manage your dependencies you should upgrade to Mockito 2.x.

10.Spring Boot 2 brings important changes to the actuator, both internal and user-facing.You should expect changes in the programming model, configuration keys and the response format of some endpoints. Actuator is now natively supported on Spring MVC, Spring WebFlux and Jersey.There is no longer a separate security auto-configuration for the Actuator.

11.Lettuce is now used instead of Jedis as the Redis driver when you use spring-boot-starter-data-redis.

12.Elasticsearch has been upgraded to 5.4+.

Following feature are removed,

1.CRaSH support

2.Auto-configuration and dependency management for Spring Mobile.

3.Auto-configuration and dependency management for Spring Social. Please check the Spring Social project for more details.

4.Dependency management for commons-digester.

5.Test support in the CLI (i.e. spring test)

Leave a Reply

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