1. Overview

Thinking of upgrading your spring boot application?  Here is a guide to walk you through the migration process.

In this post, I’d like to walk you through the process of upgrading a Spring Boot 1.x app to Spring Boot 2.

2. Dependencies

2.1 Java

Spring Boot 2.x will no longer support Java 7 and below, being Java 8 the minimum requirement.

It’s also the first version to support Java 9. There are no plans to support Java 9 on the 1.x branch. This means if you want to use the latest Java release and take advantage of this framework, Spring Boot 2.x is your only option.

2.2 Gradle

Gradle minimum supported version is 3.4

The Gradle has many value-added features to have our dependency on the central repository.

To create fat jars, bootRepackage Gradle’s task gets replaced with bootJar and bootWar to build jars and wars respectively.

It is interesting to know that Spring Boot 2.x will no longer apply the dependency management plugin by default.

If you want Spring Boot dependency management then you should add:

A few highlights regarding minimum required versions:

  • Tomcat minimum supported version is 8.5
  • Hibernate minimum supported version is 5.2

3. Steps to Upgrade

Step 1:

Assuming that you are using a Gradle build tool for building your application.

Then your build.gralde file should look like as follows

Now this will download all the required dependency jar files for Spring boot Verison 2.0.5 Release

Step 2:

Change the application properties as follows if you used any of the following properties in your application

Servlet-specific server properties

A number of server.* properties that are Servlet-specific have moved to server.servlet:

Old property New property
server.context-parameters.* server.servlet.context-parameters.*
server.context-path server.servlet.context-path
server.jsp.class-name server.servlet.jsp.class-name
server.jsp.init-parameters.* server.servlet.jsp.init-parameters.*
server.jsp.registered server.servlet.jsp.registered
server.servlet-path server.servlet.path

Here is the list of commonly used  application properties

Step 3:

Replace the deprecated methods and classes. Here are some of the deprecated classes that I come across and the respective classes

Deprecated Class New Class
org.springframework.web.context.request.RequestAttributes org.springframework.web.context.request.WebRequest
org.springframework.data.querydsl.QueryDslPredicateExecutor org.springframework.data.querydsl.QuerydslPredicateExecutor
org.springframework.boot.autoconfigure.web.DefaultErrorAttributes org.springframework.boot.web.servlet.error.DefaultErrorAttributes
org.springframework.web.context.request.ServletRequestAttributes org.springframework.web.context.request.ServletWebRequest
org.springframework.boot.web.support.SpringBootServletInitializer org.springframework.boot.web.servlet.support.SpringBootServletInitializer
WebConfigurer WebMvcConfigurer


Step 4:

Now run your main class and your application should be up and running.


In this article, we covered steps to migrate to from Spring boot 1.5.x to Spring boot 2.0.5

We discussed dependencies and how Java 8 becomes the minimum supported version.