As a spring boot developers, we use lot of time on things like building the project, restarting the application every time when there is any change made to application files in local environment. These little things kills the productivity of the developer and it’s really frustrating.

Spring boot dev tools

Spring boot introduced a solution by introducing spring boot developer tools feature in spring boot version 1.3+, which addresses these common tasks and makes the developer’s life a lot easier. In this article, we will learn how to use spring boot devtools and its advantages for developers.

Enabling the spring boot developer tools

To enable spring boot developer tools, we have to add the below dependency to our POM file if you are using maven build.

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-devtools</artifactId>
	<optional>true</optional>
</dependency>

If you are using gradle build, use the following to gradle build file.

dependencies {
    compile("org.springframework.boot:spring-boot-devtools")
}

Following are few of the features of spring devtool

Automatic Restart

Adding the spring boot devtools dependency to build file, enables the automatic restart of locally running application. Any changes in the class path content will restart the locally running server.

This feature is very helpful when we are working on IDE like eclipse, where any changes in class path files, like a controller class automatically triggers the application to restart. This makes developers life a lot easier by saving a lot of time taken to restart the running application manually.

Disable logging of auto configuration changes

Every time automatic restart happens, spring boot logs the changes like add or removal of beans, setting configuration properties, etc. This can be disabled by adding following property.

spring.devtools.restart.log-condition-evaluation-delta=false
Disabling the restart

We can disable the automatic restart by adding following property in application.properties file.

spring.devtools.restart.enabled=false
Excluding resources

We can disable automatic application restart on change of static resource files by adding following property. Following property disables the automatic restart when any change is detected under /static/ folder.

spring.devtools.restart.exclude=static/**

Live Reload

Spring boot devtools includes an embedded live reload server. This server can be used to trigger browser refresh every time when there is a change in resource files. For this, we have to add browser extension called livereload which is free to use.

This is a very useful feature when you are working with spring boot web application development, where front end is automatically reloaded in browser when there is any change in static files or code changes in java source files.

To disable this feature, we can use the following property.

spring.devtools.livereload.enabled = false

Property Defaults

Spring applications uses cache support to cache the compiled changes in template files, HTTP header, response etc. This is useful to improve performance of the application, but while development we may end up not seeing the changes done to application instantly reflecting on browser.

Spring boot devtools disables caching by default. This feature helps saving a lot of developers time and improves productivity.


Spring developer tools is a very useful tool, which makes developers life lot easier and increases the developers productivity. Let’s use this wonderful feature and happy coding. 🙂

You may also interested in