11. Packaging and Deployment

Griffon can package applications in several modes. There are 4 modes supported by default: zip, jar, webstart and applet.

To package an application use the package command. All modes will be used when calling the package command with no arguments. You can specify one or more packaging modes when executing the command. Packages will be place in their respective directory inside the `dist` directory located at the root of the application. You can configure a different default set of deployment targets that will be used when invoking this command without arguments. Simply add a configuration flag to `BuildConfig.groovy` like this

    griffon.packaging = 'zip'

Now, any time you call the package command without arguments only the `zip` target will be executed.

It is possible to specify files that can be shared across packaging modes, like a README or a LICENSE file. Make sure to place them under `griffon-app/conf/dist/shared`.

Files that should be packed inside the application's jar META-INF directory must be placed in `griffon-app/conf/metainf`. This setting works for addons too.

Packaging an application will be executed in the production environment by default. You may specify a different environment as you would with other command. This setting impacts directly how webstart and applet modes are executed, as they will sign and pack all jars by default when in production mode. Please review and update your configuration if you desire a different behavior.

Each packaging target triggers a `PackageStart` and `PackageEnd` events, with their type as the single event parameter.