如何使用 grails.plugin.location? [英] How to use grails.plugin.location?
问题描述
我有一个插件项目,我将其创建为 grails create-plugin myPlugin
.我还创建了一个普通"的 grails 项目作为 grails create-app myPluginDemo
.我正在尝试在 myPluginDemo
中安装 myPlugin
插件,但不明白如何使用 grails.plugin.location
.
I have a plugin project which I created as grails create-plugin myPlugin
. I also created a 'normal' grails project as grails create-app myPluginDemo
. I'm trying to install myPlugin
plugin in myPluginDemo
but don't understand how to use grails.plugin.location
.
我应该将 grails.plugin.location
放在 BuildConfig.groovy
中的什么位置?在 plugins
部分?在 repositories
部分?
Where do I put grails.plugin.location
inside BuildConfig.groovy
? Inside plugins
section? Inside repositories
section?
我应该向 grails.plugin.location
附加什么?应该是 grails.plugin.location.myPlugin
吗?或者 grails.plugin.location.grails-my-plugin
?还有什么?
What should I append to grails.plugin.location
? Should it be grails.plugin.location.myPlugin
? Or grails.plugin.location.grails-my-plugin
? Something else?
推荐答案
grails.plugin.location
不是依赖解析,所以它超出了 grails.project.dependency.resolution代码>.
grails.plugin.location
is not a dependency resolution, so it goes outside grails.project.dependency.resolution
.
如果myPluginDemo
和myPlugin
都在同一个目录下,应该是这样的.而且,这不会将插件安装到应用程序中,而是应用程序会引用插件的文件系统,这在开发模式下很方便.为了使用打包的插件,必须在 grails.project.dependency.resolution
It should be like below, if both myPluginDemo
and myPlugin
are in the same directory. Moreover, this will not install the plugin into the app, but the application will refer to the file system for the plugin which is convenient in development mode. In order to use the packaged plugin it has to be referred in plugins
inside grails.project.dependency.resolution
grails.plugin.location.myPlugin = "../myPlugin"
grails.project.dependency.resolution = {
repositories {
}
dependencies {
}
plugins {
}
}
这篇关于如何使用 grails.plugin.location?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!