Tomcat application bundler plugin
Dependency :
build ":tomcat-bundler:0.0.3"
Summary
A plugin to simplify bundling application with Tomcat to create a whole package to be used by hosting
Description
Usage
The plugin provides just one additional script: bundlegrails bundle
If you have just installed this plugin you'll have to refresh the project dependencies. You can do that by invoking the compile phase like this:That'll do everything there is to create a zip with Tomcat and the application in it.grails compile
Configuration
By default this plugin uses Tomcat 7.0.25 from http://ftp.tpnet.pl mirror and uses ${appName}-${appVersion}.zip for the final archive name. This can all be changed in the Config.groovy file as follows:grails.deployment.file = "final-name.zip" // name of the final archive to create grails.deployment.tomcat.version = "7.0.25" // Tomcat version grails.deployment.tomcat.url = "url-to-tomcat-archive" // full URL where Tomcat should be downloaded from
Changing Tomcat version
A common thing is to use Tomcat 6 instead of Tomcat 7 which is the plugin's default. To do so enter the following configuration options in your Config.groovy:grails.deployment.tomcat.version = "6.0.35" grails.deployment.tomcat.url = "http://www.apache.net.pl/tomcat/tomcat-6/v6.0.35/bin/apache-tomcat-6.0.35.zip"
Tomcat setup
Even though Tomcat is pretty much pre-configured by default there are some changes made by thebundle script to make it more usable in the context of a Grails application.Added conf folder to classpath
In order to be able to externalize configuration of the application and to keep it inside the Tomcat's conf folder the bundle script modifies the catalina.properties file to add the${catalina.base}/conf folder to shared.loader item. This way when you enable externalized configuration in Config.groovy like this:grails.config.locations = [ "classpath:${appName}-config.groovy" ]Copying custom files to final bundle.
In the event one would like to have extra resources copied to wherever in the resulting file there is a folder named "deployment" having the following structure:deployment + common + development + test + production
...> grails prod bundle
Those source folders will be created if they don't exists so you can simply fill in the content as you need
History
2012.02.28: Version 0.0.2
- Added ability to copy arbitrary files to resulting application archive
2012.02.15: Version 0.0.1
- Initial release