Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

When I try to run build with gradle with the -t flag:

./gradlew clean build -x test -t

I get prompt line:

Waiting for changes to input files of tasks... (ctrl-d to exit)

but when I try it with bootRun command it doesn't work/appear:

./gradlew clean bootRun -t

Does it work with Spring Boot? (I know about Spring dev tools plugin - 1.3 is not released yet)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.2k views
Welcome To Ask or Share your Answers For Others

1 Answer

andy-wilkinson is correct in his answer : gradle bootRun never completes because some applications run indefinitely. Its well documented in this issue in the grails project.

I've found a way to force bootRun to live reload the application from the command line. The key items here are the gradle daemon and the spring-boot-devtools package.

To get it to live reload you need to have 2 terminals open.

  1. gradle build --continuous

    • build --continuous will keep satisfying the initial build request until stopped
    • gradle build --continuous --quiet & 2>1 >/dev/null runs in the background, but you would miss the important build warnings/errors. gradle --stop to stop watching.
  2. gradle bootRun

    • Bootrun starts with spring-boot-devtools on classpath, which will detect changes and restart application.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...