本文介绍了使用Grails创建独立的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一个工具可以创建grails项目的可简化版本.我可以在CD或USB记忆棒上分发的东西可以在每种环境下运行.

I wonder if there is a tool which creates a demoable version of my grails projects. Something which I can distribute on a CD or USB stick which will run on every environment.

哪些东西

  • 带有一个shell脚本来启动应用程序
  • 搜索系统上的空闲服务器端口(如果已经使用8080,则不会出现错误消息)
  • 启动码头服务器
  • 使用我的应用程序启动标准浏览器

有人知道这样的工具吗?

Does anybody know of such a tool?

推荐答案

查看 独立插件 它使分发Grails应用的演示版变得更加容易.

Check out the standalone plugin it makes it a lot easier to distribute a demo version of your Grails app.

独立插件的完整文档位于此处

Full docs for the standalone plugin are here

要准备jar文件...

To prepare the jar file...

grails -Dgrails.env=demo build-standalone our_cool_demo.jar

要运行Grails应用程序(将端口指定为参数)...

To run the Grails app (the port is specified as a parameter)...

java -jar /path/to/jar_name.jar cool_demo localhost 9000

更新:

实际上有2个Grails独立插件:

There are actually 2 Grails standalone plugins:

  1. 上述基于 Tomcat7 '独立'插件>
  2. ' jetty-standalone '插件,该插件基于 Jetty ,并且以类似的方式工作
  1. The 'standalone' plugin described above which is based on Tomcat7
  2. The 'jetty-standalone' plugin which is based on Jetty and works in a similar way

还有一些基于Hudson和Winstone项目的选项,但是没有Grails插件.以下是一些包含更多信息的链接: 建立可执行文件之战使用grails,maven和jetty 带有Jetty的可执行WAR Winstone

There are also some options based on Hudson and the Winstone project but there isn't a Grails plugin. Here are some links with further information: Build executable war using grails, maven and jetty, Executable WARs with Jetty and Winstone

这篇关于使用Grails创建独立的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-26 15:17
查看更多