Check out the standalone plugin , which greatly facilitates the distribution of the demo version of your Grails application.
"A stand-alone plug-in creates an executable JAR file with a built-in war built from your application and a built-in instance of Tomcat 7. This allows you to create a single archive that can be run on any computer with Java 5 or higher by running java -jar standalone.jar. It can be convenient for demonstration or even very easy installation with low traffic Grails ".
Full documents for standalone plugin here
To prepare the jar file ...
grails -Dgrails.env=demo build-standalone our_cool_demo.jar
To start the Grails application (port specified as parameter) ...
java -jar /path/to/jar_name.jar cool_demo localhost 9000
Update:
There are actually 2 standalone Grails plugins:
- The following is a standalone plugin that is based on Tomcat7
- The plugin is standalone , based on Jetty and works in a similar way.
There are also some options based on the Hudson and Winstone project, but there is no Grails plugin. Here are some links with more information: Build an executable war using grails, maven and jetty , Executable WARs using Jetty and Winstone
Chris source share