21

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?

Eric Bennett
  • 211
  • 1
  • 2
  • 4
  • 2
    A little late here, but it appears that auto-recompilation of GSP files is disabled for custom run environments, and for some reason Grails also ignores the `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. – Aquatoad Feb 25 '11 at 21:04

3 Answers3

18

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

Run Config changes

Blog post about auto refresh in a Grails custom env

anataliocs
  • 10,427
  • 6
  • 56
  • 72
3

The flag you want is "disable.auto.recompile", ex:

grails -Dgrails.env=custom -Ddisable.auto.recompile=false run-app
Ted Naleid
  • 26,511
  • 10
  • 70
  • 81
  • 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? – Eric Bennett Aug 26 '09 at 00:12
  • 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. – Ted Naleid Aug 26 '09 at 01:05
  • Nope, doesn't seem to happen for me, does in dev mode though... very strange. – Eric Bennett Aug 26 '09 at 04:09
0

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

  • 2
    Please spend some more effort writing an answer. Start with complete sentences and punctuation. – GhostCat Nov 29 '17 at 15:53
  • 1
    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 – Pabel Dionicio Lopez Mena Nov 29 '17 at 18:47