What is Spring Boot DevTools?

Answer

Spring Boot DevTools provides developer-friendly features that improve the development experience without affecting production behavior. Add: spring-boot-devtools as a optional or test scope dependency — excluded from production JAR automatically. Key features: (1) Automatic restart: monitors classpath for changes (typically after Maven/Gradle build or IDE save). When a class changes, Spring restarts the application in ~1-2 seconds (much faster than a cold start). DevTools uses two classloaders: one for unchanging dependencies, one for application code — only the application classloader restarts; (2) LiveReload: includes an embedded LiveReload server. Browser extensions automatically refresh the browser when resources (templates, CSS, JavaScript) change; (3) Disabled caching: DevTools disables template engine caching (Thymeleaf, FreeMarker), so changes are reflected immediately without restart. Example: spring.thymeleaf.cache=false is set automatically; (4) H2 console: enables H2 web console automatically when H2 is on the classpath and Spring Security is not; (5) Remote DevTools: enables remote application restart over HTTP (for remote debugging — less commonly used); (6) Global settings: ~/.config/spring-boot/spring-boot-devtools.properties for user-level dev settings. Configuration: specify which paths to watch: spring.devtools.restart.additional-paths=.. Exclude paths: spring.devtools.restart.exclude=static/**,public/**.