0

I am developing in grails 3.2.8 and the code hot swap simply does not work. I know that i should talk to spring boot, but perhaps someone had the tailored fix for grails. BTW, i had a quick look at the spring boot questions but could not find anything related to hot swap. Am I the only one with this problem?!

Fabio Sogni
  • 187
  • 1
  • 11
  • I realized that the hot swap doesn't work outside the 'development' environment. I created a parallel development environment 'cloneDev' and the hot swap doesn't work there. So...problem solved. Another question could be: how can I have the hot swap under 'cloneDev' ? – Fabio Sogni Jul 07 '17 at 14:43

1 Answers1

0

Add the following to build.gradle:

import grails.util.Environment

bootRun {

    final Boolean reloadEnabled =
            Boolean.valueOf(
                    System.properties[Environment.RELOAD_ENABLED])

    if (reloadEnabled) {
        systemProperty Environment.RELOAD_ENABLED, reloadEnabled
    }

}

Then start the application with:

grails -Dgrails.env=custom -Dgrails.reload.enabled=true run-app

Credit to Hubert Klein Ikkink

Fabio Sogni
  • 187
  • 1
  • 11