stewchicken
stewchicken

Reputation: 531

org.springframework.boot hotdeploy does not work at gradle

As we know org.springframework.boot support hot deploy to detect any changes without restart application.

It works with maven when I run it with mvn spring-boot:run but it does not work when I run it with gradle bootRun, it does not detect property file change automatically .

in my build.gradle i defined it already.

any hints will be more than welcome!

compile group: 'org.springframework.boot', name: 'spring-boot-devtools', version:'2.0.4.RELEASE'

Upvotes: 1

Views: 507

Answers (1)

Andy Wilkinson
Andy Wilkinson

Reputation: 116171

You probably need to configure bootRun to load resources from src/main/resources rather than their built location beneath build. You can do so with the following configuration:

bootRun {
    sourceResources sourceSets.main
}

Alternatively, you could use Gradle's continuous build support so that any changes in src/main/resources or src/main/java are automatically detected and then built. DevTools will then notice the changes in the build's output and reload.

Upvotes: 2

Related Questions