Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails Detect if a Plugin is Installed

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.

like image 822
Scott Warren Avatar asked May 31 '10 03:05

Scott Warren


People also ask

Where are Grails plugins stored?

By default the plugins are in . grails/<version>/<project>/plugins . You can change it by setting grails. project.

What is a Grails plugin?

Grails plugin which allows you to view files stored on the file system.


1 Answers

You can use the plugin manager for this:

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

if (PluginManagerHolder.pluginManager.hasGrailsPlugin('acegi')) {
   ...
}
like image 185
Burt Beckwith Avatar answered Nov 13 '22 06:11

Burt Beckwith