Reputation: 187499
When developing a Grails plugin, you can configure it to reload using either the watchedResources
or observe
properties. From my reading of the official docs, it seems that the former will cause the plugin to reload when a file changes, and the latter when a plugin changes, is that correct?
Say for example, a plugin needs to reload itself any time a Grails service changes, are the following equivalent?
def watchedResources = "file:./grails-app/services/*Service.groovy"
def observe = ["services"]
Thanks, Don
Upvotes: 3
Views: 1950
Reputation: 75671
These are both described here: http://www.grails.org/Auto+Reloading+Plugins
Your plugin won't be reloaded, rather an event will be fired that you can handle in your onChange() callback. One use case is annotated artifacts; if you monitor changes in those and one gets changed, you can re-run whatever configuration changes you made based on the new values.
Upvotes: 4