Configuring dynamic application restart triggers
In the previous recipes, we have looked into the basic capabilities of DevTools when it comes to restarting the application upon code or resource change and communicating to the browser to reload the page. This section will address the various configuration options that we can leverage to indicate to Spring Boot DevTools exactly what we want those events to be triggered by, and when.Â
How to do it...
By default, adding a DevTools module to a project will make it monitor all the classes or resources, which could become undesired behavior, especially when it comes to multi-module repositories. This becomes true when building and launching projects from within an IDE like IntelliJ or Eclipse. We need to tell DevTools to exclude the db-count-starter
sub-module in our project from the watch list by adjusting the configuration settings:
- Let's create a file named
spring-devtools.properties
under theÂdb-count-starter/src/main/resources/META-INF
directory...