Developer tools

Spring Boot provides tools that can improve the experience of developing Spring Boot applications. One of these is Spring Boot developer tools.

To use Spring Boot developer tools, we need to include a dependency:

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

Spring Boot developer tools, by default, disables the caching of view templates and static files. This enables a developer to see the changes as soon as they make them.

Another important feature is the automatic restart when any file in the classpath changes. So, the application automatically restarts in the following scenarios:

  • When we make a change to a controller or a service class
  • When we make a change to the property file

The advantages of Spring Boot developer tools are as follows:

  • The developer does not need to stop and start the application each time. The application is automatically restarted as soon as there is a change.
  • The restart feature in Spring Boot developer tools is intelligent. It only reloads the actively developed classes. It does not reload the third-party JARs (using two different class-loaders). Thereby, the restart when something in the application changes is much faster compared to cold-starting an application.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset