When running a custom environment with grails via grails -Dgrails.env=custom run-app it appears that the auto reload / hot deploy is turned off, does anyone know how to arbitrarily enable this for any given environment, not just dev, which appears to be the only env where it is actually on by default?
Grails auto reload functionality in run-app on a custom environment
Asked Answered
I resolved this by adding the following to my env(custom in this case) Config.groovy:
custom {
disable.auto.recompile=false
grails.gsp.enable.reload=true
}
You can also add the -reloading flag to your run config:
grails -reloading -Dgrails.env=custom run-app
Make sure it is the first arg!
Right-click your project -> Run as -> Run configurations
Is it for Just GSP files? What about making it auto reload for all kind of files not limited to GSP only? –
Cyrillic
What types of files are you seeing not reloading @ishwor? –
Headwaters
You said, make sure it's the first arg, but in the screenshot it's the 2nd arg. Is that a typo? –
Serow
Yes, the screenshot is outdated, I need to update it –
Headwaters
The flag you want is "disable.auto.recompile", ex:
grails -Dgrails.env=custom -Ddisable.auto.recompile=false run-app
This seems to be shaky, for example raw code changes in a controller or service it works for, but say js, css, or html changes within the application views or web-app dir, no dice? –
Coleslaw
Those don't get auto-loaded for you anyway? Weird, that works fine for me even without the disable.auto.recompile. Do you have something cached? If you're using firefox hit cmd-shift-R (or ctl-shift-R on windows) to reload and bypass the cache. –
Pritchett
Nope, doesn't seem to happen for me, does in dev mode though... very strange. –
Coleslaw
solve the problem with the name change of my folder containing the project ... this time a name that had spaces ... since quite the spaces everything started to work well
Please spend some more effort writing an answer. Start with complete sentences and punctuation. –
Schmit
Sorry, what I want to say is that I solve the problem by changing the name of the folder that contains my project. previously the folder had a name that contained spaces, after removing those spaces everything worked well .. Example my folder to myfolder –
Jetta
© 2022 - 2024 — McMap. All rights reserved.
disable.auto.recompile
flag. I was able to get GSP files to recompile by passing in-Dgrails.gsp.enable.reload=true
to the run-app script. – Fimble