如何在Web服务器上编译包括Grails插件项目的Grails应用程序? [英] How can I compile a Grails App including a Grails Plugin-Project on my Webserver?

查看:65
本文介绍了如何在Web服务器上编译包括Grails插件项目的Grails应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为 AProject 的Grails项目和一个名为 MyPlugin 的Grails插件.

I have a Grails Project with name AProject and a Grails Plugin with name MyPlugin.

我将 MyPlugin 集成到 AProject 中,方法是将BuildConfig.groovy添加为:

I integrate my MyPlugin into AProject, by adding to BuildConfig.groovy as:

plugins {
   ...
  compile ":elasticsearch:0.50" 
}

grails.plugin.location.'elasticsearch' = "../elasticsearch"

然后在本地计算机上的MyPlugin文件夹中进行

On my local computer I then do in the MyPlugin folder

grails maven-install

并在AProject文件夹中:

and in the AProject folder:

grails clean
grails refresh-dependencies
grails run-app

这在我的本地计算机上工作正常,但在我的服务器上却没有.

This is working fine on my local computer, but not on my server.

如何在服务器上集成Grails插件项目?

How can I integrate a Grails plugin project on my server?

推荐答案

  • grails maven-install //in plugin project if you have .m2 <local maven repo>
  • compile ':my-plugin:0.1' //in Grails app BuildConfig plugin section
  • grails war //in grails app
  • 在任意位置部署war.
    • grails maven-install //in plugin project if you have .m2 <local maven repo>
    • compile ':my-plugin:0.1' //in Grails app BuildConfig plugin section
    • grails war //in grails app
    • Deploy the war wherever you want.
    • 如果这是您想要的,那么您将不需要任何其他东西.

      If this is what you want then you would need nothing else.

      Grails会将所有编译的文件打包到war文件中. Grails应用程序将在构建War文件时从Maven存储库(在本例中为本地Maven存储库)中提取插件工件.

      Grails will package all compiled files into the war file. The Grails app would pull the plugin artifact from the maven repo (in this case your local maven repo) while building the war file.

      如果您在与maven install插件相同的机器上进行战争,则grails应用程序会找到它,您应该会很好.

      If you are building the war on the same machine that you did maven install for the plugin your grails app will find it and you should be good.

      这篇关于如何在Web服务器上编译包括Grails插件项目的Grails应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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