views:

21

answers:

1

Is there a way in Grails to Detect that a plugin is installed. For example I need to know if the "Acegi" plugin is installed. If it is then I can run different Code. If the plugin is not installed (which is a viable option) then I can run different code.

Thanks in Advance.

+2  A: 

You can use the plugin manager for this:

import org.codehaus.groovy.grails.plugins.PluginManagerHolder

if (PluginManagerHolder.pluginManager.hasGrailsPlugin('acegi')) {
   ...
}
Burt Beckwith