How it works...

In this recipe, we have looked at a number of different reload trigger configurations, so let's look at each of them individually to understand where best to use them:

  • spring.devtools.restart.enabled: This property offers the simplest of controls, fully enabling or disabling the restart functionality of DevTools. With the value of false, no restart of the application will take place, regardless of the class or resource changes on the classpath.
  • spring.devtools.restart.exclude: This property provides an ability to stop specific classpaths from being reloaded. This property accepts values in a comma-separated form using the Ant Path matching pattern style. The default exclude value is "META-INF/maven/**,META-INF/resources/**,resources/**,static/**,public/**,templates/**,**/*Test.class,**/*Tests.class,git.properties,META-INF/build-info.properties" ...

Get Developing Java Applications with Spring and Spring Boot now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.