Spring Boot - DevTools

Last Updated : 28 Mar, 2026

Spring Boot DevTools is a module provided by Spring Boot to enhance the developer experience during application development. It helps improve productivity by reducing manual effort and speeding up the development cycle.

  • Automatic Restart: Restarts the application automatically when code changes are detected
  • Live Reload: Refreshes the browser automatically after changes
  • Property Defaults: Applies sensible development-time configurations automatically
  • Global Settings: Allows configuration across multiple projects
  • Remote Debug Tunneling: Enables debugging of applications running in remote environments
Working of Spring Boot - DevTools
Working of Spring Boot - DevTools

Note: It is important to understand that the 'DevTools' is not an IDE plugin, nor does it require that you should use a specific IDE.

DevTools Configuration in Spring Boot

There are a few configurations required to use DevTools in your Spring Boot Application

1. Spring Boot Devtools Dependency

For Maven build automation tools dependency is-

XML
<!--Maven pom.xml-->

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-devtools</artifactId>
   <scope>runtime</scope>
</dependency>

For Gradle build automation tools dependency is-

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

OR

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

2. Application Properties Settings for Spring Boot DevTools

Some configurations are available for application properties files to use Spring Boot DevTools.

2.1 Toggle DevTools

It can be used to customize the detection of classpath changes to trigger auto restart if your Spring Boot Application

spring.devtools.restart.enabled=true

2.2 Exclude Resources from DevTools

It can be used to specify certain resources that will excluded to trigger a restart of your Spring Boot Application.

spring.devtools.restart.exclude=resources/**,web-inf/**

for the above code 'resources' and 'web-inf' resources are excluded

2.3 Enable/Disable LiveReloader for DevTools

To customize the use of LiveReloader use this configuration

spring.devtools.livereload.enabled=true/false

3. Verify Spring Boot DevTools Configuration

On adding DevTools dependencies, the word 'devtools' appears alongside your project name.

The below images depict that the project has dev tools in a folder structure and Spring Boot Dashboard.

Folder Structure demonstrating DevTools is enabled in your project


Boot Dashboard in STS

Note:

  1. DevTools is neither a plugin nor an IDE-specific functionality, it works equally well in the STS ( Spring Tool Suite ), IntelliJ IDEA, and also Netbeans. 
  2. DevTools were built only for development-specific purposes, it is very smart enough that it disables itself when the application is deploying in a production setting.

Usage of Spring Boot DevTools

DevTools provides the Spring Boot developers with some development time tools that ease the development process. Some of these important workings are as follows-

1. Automatic application restart

Automatically restarts the application when changes are made to Java code or configuration files. Uses two class loaders:

  • One for dependencies (libraries)-> rarely changes
  • One for application code (e.g., src/main/)-> frequently changes

On detecting changes, only the application class loader is reloaded, while the JVM and dependency class loader remain intact

This significantly reduces restart time and improves developer productivity

Console
Console

Global setting config for Spring Boot DevTools

Devtools provides a way to configure global settings that are not coupled with any application.

  • This file is named .spring-boot-devtools.properties and is located at $HOME.
  • If it is not configured manually, then defaults will be used by DevTools automatically.
Console
Console

Note: On automatic application restart, the changes to dependencies won't be available. Because the respective class loader isn't automatically reloaded. Therefore, after making the changes to dependencies, you have manually restart the application to get those changes in effect.

2. Automatic disable of template caches project

Spring Boot supports template engines like Thymeleaf, FreeMarker, and Groovy, which cache templates by default to improve performance. However, caching makes it difficult to see changes during development without restarting the application.

With Spring Boot DevTools:

  • Template caching is automatically disabled during development
  • Changes in templates are reflected immediately after browser refresh
  • Eliminates the need to restart the application for UI updates

Note: We can manually control caching using: spring.thymeleaf.cache=true/false in application.properties

3. Spring Boot Devtools as Live Reloader Server

When developing applications, manually refreshing the browser after every change can be time-consuming. Spring Boot DevTools solves this by enabling automatic browser refresh.

  • DevTools starts an embedded LiveReload server along with the application
  • With a LiveReload browser plugin, the browser refreshes automatically on file changes
  • Works for changes in templates, CSS, JavaScript, and other frontend resources
  • Supported in browsers like Chrome, Firefox, and Safari (not available for Internet Explorer/Edge)
Console
Console

4 H2 Console

Your application additionally may require a database. Spring Boot offers you a very essential feature of an embedded H2 database which is very helpful for development purposes.

  • When we add an H2 database dependency in the application build, DevTools will automatically enable an H2 console.
  • You can access this console from your web browser itself.
  • This helps us to get an insight or overview of the data that is used or handled by the application.

To access this console, you have to simply point your web browser to - http://localhost:8080/h2-console.

Comment

Explore