如何在 Grails 2.0 中运行本地插件? [英] How to run a local plugin in Grails 2.0?

查看:25
本文介绍了如何在 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.

我发现如果插件列在 application.propertiesBuildConfig.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆