使用Grails创建独立的应用程序 [英] Create standalone application with grails

查看:81
本文介绍了使用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.

"独立插件构建了带有嵌入式war的可运行JAR文件 由您的应用程序和嵌入式Tomcat 7实例构建.这 允许您构建一个可以在任何计算机上运行的存档 Java 5或更高版本,只需运行java -jar standalone.jar.这可以是 方便演示,甚至轻量级的低流量安装 Grails应用程序."

"The Standalone plugin builds a runnable JAR file with an embedded war built from your application and an embedded Tomcat 7 instance. This allows you to build a single archive that can be run on any computer with Java 5 or higher by running java -jar standalone.jar. This can be convenient for demos or even very lightweight installs of low-traffic Grails applications."

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

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创建独立的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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