且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将私有插件的grails应用程序部署到云中

更新时间:2022-10-20 16:54:10

我最终在Grails 2.1.0中做了以下工作来解决这个问题: / p>

在Grails插件项目中:

grails package-plugin       生成grails-myplugin-0.1.zip文件


$ b 2)将插件复制到我的应用程序的lib目录(appOne / lib / grails-myplugin-0.1 .zip)
$ b 在BuildConfig.groovy中


  • 删除: grails.plugin.location.compilemyPlugin =../myPlugin

    这在开发过程中用于防止重建 - 重新安装过程

    更新插件中包含的文件。

  • plugins {
    .....
    compile':grails-myPlugin:0.1'
    }


4)通过清理appOne进行测试并重新运行,这将通过lib目录安装/重新安装插件。

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.