Grails检测是否安装了插件 [英] Grails Detect if a Plugin is Installed
本文介绍了Grails检测是否安装了插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
感谢提前。
解决方案
您可以使用插件管理器来执行此操作:
import org。 codehaus.groovy.grails.plugins.PluginManagerHolder
if(PluginManagerHolder.pluginManager.hasGrailsPlugin('acegi')){
...
}
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.
解决方案
You can use the plugin manager for this:
import org.codehaus.groovy.grails.plugins.PluginManagerHolder
if (PluginManagerHolder.pluginManager.hasGrailsPlugin('acegi')) {
...
}
这篇关于Grails检测是否安装了插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文