1

I come from Grails background and there was a feature where our changes to CSS, HTML & JS files were instant and didn't needed rebuilding code again.

Now, while building a Micronaut project I would like to have something similar but I am unable to figure how to configure Gradle for same.

Till now, I found out if I make changes to copied resources inside build folder, changes are reflected on browser and don't require rebuilding code but this forces me to do changes to original file later.

Can I somehow make Gradle directly use src/main/resources from it's original location rather than Gradle copying it to build folder?

Aditya T
  • 1,566
  • 2
  • 13
  • 26

1 Answers1

0

You might be looking for ./gradlew run --continuous but depending on what things you are changing in the resources/ folder, those changes may nor may not affect the running app without restart.

More information is available at https://docs.micronaut.io/1.1.2/guide/index.html#reloading.

I hope that helps.

Jeff Scott Brown
  • 26,804
  • 2
  • 30
  • 47
  • Sadly, I already went through the documentation but it does not solve my problem, one problem with above approach is micronaut session, I am forced to login again every time application starts. Also having static images ( about 400 MB folder ) inside resource folder also slows down the startup time drastically which makes hot reloading more of a problem rather than benefit. – Aditya T Jun 04 '19 at 12:31
  • "...one problem with above approach is micronaut session, I am forced to login again every time application starts..." - there is no way around that, but using `--continuous` doesn't cause the application to restart. It causes Gradle to run the build continuously, which is a separate thing than restarting the app. – Jeff Scott Brown Jun 04 '19 at 14:29