如何在Grails 2.0中运行本地插件? [英] How to run a local plugin in Grails 2.0?
问题描述
在Grails中,有一个变体如何从源代码包含本地插件。根据文档,可以输入 BuildConfig.groovy
:
In Grails, there is a variant how to include local plugin from sources. According to docs, one may type in BuildConfig.groovy
:
// Useful to test plugins you are developing.
grails.plugin.location.shiro =
"/home/dilbert/dev/plugins/grails-shiro"
// Useful for modular applications where all plugins and
// applications are in the same directory.
grails.plugin.location.'grails-ui' = "../grails-grails-ui"
问题在于它在Grails 2.0.RC1中不起作用。我试过做 grails clean
,用 grails install-plugin
安装插件,并将它放到 BuildConfig.groovy
。仍然无法解决。
The problem is that it doesn't work in Grails 2.0.RC1. I've tried to do grails clean
, to install plugin with grails install-plugin
and to place it to BuildConfig.groovy
. Still unable to resolve.
推荐答案
这适用于我
grails.plugin.location.shiro = "/home/dilbert/dev/plugins/grails-shiro"
其中 shiro
是插件的名称(不是它所在目录的名称)。确保插件的路径是绝对路径或应用程序插件的相对路径。
Where shiro
is the name of the plugin (not the name of the directory it's in). Make sure the path to the plugin is either an absolute path or the relative path to the plugin from the application.
我发现这有时不起作用if该插件列在 application.properties
或 BuildConfig.groovy
中,所以如果是,请将其删除,然后执行 grails clean
并重新启动应用程序。
I've found that this sometimes doesn't work if the plugin is listed in application.properties
or BuildConfig.groovy
, so if it is, remove it, then execute grails clean
and restart the app.
这篇关于如何在Grails 2.0中运行本地插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!