I created a Grails plugin (grails create-plugin myplugin1
) and noticed that there was no myapp1/grails-app/conf/BootStrap.groovy
created like you normally get when you create a Grails app.
I created one like so:
class BootStrap {
def init = {
println("Hello! The plugin is bootstrapping...")
}
def destroy = {
}
}
I then include the plugin with a Grails app (by adding myplugin1
as a plugin inside the app's BuildConfig.groovy
). When I issue a grails run-app
, I don't see the above println
ever executing.
Do Grails plugins not use BootStrap.groovy
? If so, where should I put "bootstrap" code that needs to be executed when a plugin is loaded? Otherwise, if I was correct to do this above, why might I not be seeing the "Hello! The plugin is bootstrapping..." message print out?