Skip to content

Devtools always triggers restart if build with gradle #20136

Closed
@Dazzel

Description

@Dazzel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fixstatus: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions