Grails 2.X 中的内联插件是什么?如何使插件内联?我可以找到 documentation适用于 Grails 3,但不适用于 Grails 2。
最佳答案
plugins 的文档部分概述了 Grails 2.x 中的内联插件。 .
从文档中:
An application can load plugins from anywhere on the file system, even if they have not been installed. Specify the location of the (unpacked) plugin in the application's grails-app/conf/BuildConfig.groovy file
使用
grails create-plugin
创建内联插件命令,就像一个非内联插件。内联插件和常规插件之间唯一真正的区别是应用程序引用它的方式。普通插件是从存储库(例如 maven)中提取的,而内联插件以源格式存在于使用它的应用程序本地。举个例子:
/usr/foo/grails/MyApplication
/usr/foo/grails/MyInlinePlugin
/usr/foo/grails/MyOtherInlinePlugin
通过使用
BuildConfig.groovy
中的以下内容,上述应用程序 (MyApplication) 可以包含列为内联插件的两个插件。// BuildConfig.groovy
grails.plugin.location.'my-inline-plugin' = "../MyInlinePlugin"
grails.plugin.location.'my-other-inline-plugin' = "../MyOtherInlinePlugin"
在开发(或测试)插件以及创建模块化 Grails 应用程序时,整体内联插件非常有用。
关于grails - 什么是内联插件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31007244/