micronautlivereload

How to disable Micronaut auto-reload feature?


My Micronaut app is being auto restarted every time I change any file (md, js, html) outside of src/ directory.

On app start I see this line in the log:

Watching for changes in [myapp, myapp/src/main/java, myapp/src/main/resources]

So, server is watching for changes in the project root, which is completely wrong.

I tried to disable every option in micronaut.io.watch.*, but it has no effect.

How to disable this feature? I neither need or want to use it.


Solution

  • This is a feature of the Micronaut Maven plugin, and it can be disabled by passing the mn.watch flag when running, e.g., ./mvnw mn:run -Dmn.watch=false, or you can edit your pom and add a <watchForChanges> element. See the docs at https://micronaut-projects.github.io/micronaut-maven-plugin/latest/run-mojo.html