Spring Boot DevTools is a development-time library that shortens the edit-run-test cycle for Spring applications. It watches project changes, restarts the application when Java code or properties change, refreshes browser resources, disables template caches, and can provide an H2 Console when H2 is in use. section 1.3.4 section 1.3.5
DevTools provides several practical development conveniences:
- Restarts the application after changes to Java code or properties files. section 1.3.5
- Refreshes browser-destined resources such as templates, JavaScript, and stylesheets when they change. section 1.3.5
- Disables template caching during development, making edited views visible without manually changing every template engine property. section 2.5.1
- Works independently of the IDE and disables itself when the application is deployed for production. section 1.3.5
A faster edit-and-test loop
Run the Spring application, change a controller, property, or template, and return to the browser after a brief delay. DevTools reloads the class loader containing project code, restarts the Spring application context, and leaves dependency libraries and the JVM intact. Template caching is disabled during development; deployment disables DevTools and restores template caching. section 1.3.5 section 2.5.1
Table 2.3 Properties to enable/disable template caching (view table figure)
Use the template-cache table to identify the cache property associated with FreeMarker, Groovy templates, Mustache, or Thymeleaf when explicit configuration is needed. section 2.5.1
