Micronaut-core: Live reload is not working

Created on 16 Jul 2019  路  3Comments  路  Source: micronaut-projects/micronaut-core

Task List

  • [x] Steps to reproduce provided
  • [x] Stacktrace (if present) provided
  • [x] Example that reproduces the problem uploaded to Github
  • [x] Full description of the issue provided (see below)

Steps to Reproduce

  1. With Micronaut version 1.1.4 on macOS run mn create-app myapp --features file-watch.
  2. Run ./gradlew run --continuous.
  3. Visit the /hello route and note what response you got.
  4. Change the string returned from function index in the src/main/java/myapp/HelloController.java file and save the file.
  5. After a moment, visit the /hello route and see that the response hasn't changed.

Expected Behaviour

The server should be stopped so that Gradle can rebuild and restart the application.

Actual Behaviour

$ ./gradlew run --continuous

> Task :compileJava
Note: Creating bean classes for 1 type elements

> Task :run
23:46:58.577 [main] INFO  io.micronaut.runtime.Micronaut - Startup completed in 730ms. Server Running: http://localhost:8080
<=========----> 75% EXECUTING [32s]
> :run

At this point (at 75%) Gradle hangs and never gets to restart.

Environment Information

  • Operating System: macOS 10.14.5
  • Micronaut Version: 1.1.4
  • JDK Version: 11.0.2

Also, Gradle:

$ ./gradlew --version

------------------------------------------------------------
Gradle 5.1.1
------------------------------------------------------------

Build time:   2019-01-10 23:05:02 UTC
Revision:     3c9abb645fb83932c44e8610642393ad62116807

Kotlin DSL:   1.1.1
Kotlin:       1.3.11
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          11.0.2 (Oracle Corporation 11.0.2+9-LTS)
OS:           Mac OS X 10.14.5 x86_64

Example Application

This is the application I get from running create-app with --features file-watch and one file added: https://github.com/dchenk/micronaut-reload-demo

live-reload

Most helpful comment

This seems to still be an issue. Micronaut 1.3.0

All 3 comments

This was fixed by https://github.com/micronaut-projects/micronaut-core/commit/e4f1431a2746628593910853cdf6675bb47c9978 if you are willing to use 1.2 RC2

In the meantime I have backported the fix. Thanks for the report.

Broken again for Micronaut 1.2.0 and Gradle 5.5?
Simple test with ./gradlew run --continuous does not detect changes in source files.

This seems to still be an issue. Micronaut 1.3.0

Was this page helpful?
0 / 5 - 0 ratings