更新时间:2022-10-20 16:54:10
我最终在Grails 2.1.0中做了以下工作来解决这个问题: / p>
在Grails插件项目中: grails package-plugin
生成grails-myplugin-0.1.zip文件
删除: grails.plugin.location.compilemyPlugin =../myPlugin
这在开发过程中用于防止重建 - 重新安装过程
更新插件中包含的文件。
5)提交所有更改并将插件zip文件添加到appOne并推送。在这种情况下,云提供程序
Heroku可以解析依赖关系。
I've created a private plugin for domain objects that are shared between two grails applications. I'm able to use the plugin successfully in my local environment as I've set the path to it via the BuildConfig file. For example, I have the following directories:
appOne/
myPlugin/grails-my-plugin-0.1.zip (myPlugin is a grails plugin project dir)
In: appOne/grails-app/conf/BuildConfig.groovy:
grails.plugin.location.compileMyPlugin = "../myPlugin"
My question is, what is the proper/best way to handle "packaging" this plugin with my app release so I can deploy it to a cloud service where it won't be available for download? I imagine there is a way to have grails do this for you but I'm unsure. (I'm very new to grails)
I ended up doing the following to resolve this in Grails 2.1.0:
1) In the Grails Plugin Project:grails package-plugin
Produces the grails-myplugin-0.1.zip file
2) Copy plugin to my application's lib directory (appOne/lib/grails-myplugin-0.1.zip)
3) In BuildConfig.groovy
Remove: grails.plugin.location.compilemyPlugin = "../myPlugin"
This was/is used during development to prevent the rebuild-reinstall process
when updating files included in the plugin.
Add:
plugins {
.....
compile ':grails-myPlugin:0.1'
}
4) Test by cleaning appOne and re-run which will install/re-install the plugin via the lib directory
5) Commit all changes and add the plugin zip file to appOne and push. The cloud provider,
Heroku in this case, can then resolve the dependency.