Create standalone application with grails
grails
Solution
Check out the standalone plugin it makes it a lot easier to distribute a demo version of your Grails app.
"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
To prepare the jar file...
grails -Dgrails.env=demo build-standalone our_cool_demo.jar
To run the Grails app (the port is specified as a parameter)...
`java -jar /path/to/jar_name.jar cool_demo localhost 9000`
Update:
There are actually 2 Grails standalone plugins:
- The 'standalone' plugin described above which is based on Tomcat7
- The 'jetty-standalone' plugin which is based on Jetty and works in a similar way
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
Problem
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. Something which - comes with one shell script to start the app - searches for a free server port on the system (no error message if 8080 is already in use) - starts a jetty server - starts the standard browser with my application Does anybody know of such a tool?