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
Does anybody know of such a tool?
Go to start.grails.org and use the Grails Application Forge to generate your Grails project. You can choose your project type (Application or Plugin), pick a version of Grails, and choose a Profile - then click "Generate Project" to download a ZIP file. No Grails installation necessary!
Grails (more precisely it's latest major version) is a framework built on top of the Spring Boot project and uses the Apache Groovy language to develop web apps. It's inspired by the Rails Framework for Ruby and is built around the convention-over-configuration philosophy which allows reducing boilerplate code.
Grails MVC (Model / View / Controller) Pattern Grails follows a very popular pattern in web applications development, called Model – View – Controller. The pattern organizes the software in 3 layers: Model or data layer: contains all the components that represents and manage data stored in our application.
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:
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
Best thing that comes to mind is using a Linux distro on a USB stick with grails installed. You can export the application as a WAR file, then create a script containing grails prod run-war
to execute on boot. Finally, you can open up firefox with firefox localhost:port#/AppName
The only downside with this option is you need to boot from the stick and that will create a bit of delay time. However, the advantages are that you only have to worry about supporting one OS, no port scanning on startup and simplicity.
The answer proposed by Chris does not work for my, but it provided me a good starting point: It seems that it isn't too hard to create such a standalone app:
that's it. I guess I'll post more details when I find some more time...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With