I have a pretty standard 2.0.3 Grails app and I’ve executed grails install-templates which places files list.gsp, edit.gsp, etc. in src/templates/scaffolding/ directory. These files are not automatically reloaded when a change is made to them. Is there a way I can get these to be automatically reloaded so I don’t have to stop/start the app every time I make a change? I’ve tried looking at watchedResources but that seems to be plugin development related.
I have a pretty standard 2.0.3 Grails app and I’ve executed grails install-templates which
Share
You are correct that the “watched-resources” mechanism only applies to plugins. The correct fix for this would be to modify the core
ScaffoldingGrailsPlugin.groovyto addand it’s probably worth submitting a JIRA to that effect. In the mean time, you may be able to get it working by writing a simple plugin of your own to “inject” this behaviour into the scaffolding plugin. Do
grails create-plugin watch-scaffoldingand then use the following for the plugin descriptor:Now in your application’s
BuildConfig.groovyadd(or whatever is the appropriate relative path from the root of your app to the root of the plugin) and your scaffolding template changes should start to reload automatically.
(This is tested on Grails 2.1, I initially tried using influences but it didn’t have any effect, however forcing an
onChangeevent in the scaffolding plugin had the required result.)