Description
Spring Boot version: 2.2.4.RELEASE
Gradle version: 6.0.1
Clean project created inside IntelliJ IDEA (2019.3) via the initializr., with the devtools dependency added.
The devtools docs state that a restart only occurs on some classpath changes. Especially following paths are excluded by default: /META-INF/maven,/META-INF/resources,/resources,/static,/public,/templates
and should not trigger a restart but should reload.
When using the default settings of IntelliJ and running the application via its internal run configuration the build process is delegated to gradle. Thus everything related to processing resources, running annotation processors and compiling java classes is delegated to the gradle process. Now the infuriating things are happening: Even when modifying an excluded file, like templates/index.html
the whole application restarts. It seems like, gradle is always copying ALL resources to the output (build) directory and so the devtools file change listener registers them as "modified" but they are not.
Using the Update action inside IntelliJ does not help. Even using the trigger file method will always result in a complete restart. Using update resources
does not help either. See the jetbrains docs for more information.
I do not know, if this is fixable with an gradle option or if the devtools need an more sophisticated process to detect changes. It seems it only compares filesize, and timestamp of files.
Simple demo app, created with the initializr: demo_app.zip