The package goal packages any self-executable SeedStack application in a Capsule. A Capsule is a way of packaging and running any application with all its dependencies from a unique plain executable JAR.

Self-executable SeedStack application are applications that contains one and only one implementation of the SeedLauncher interface in their classpath, like the one provided by the seed-cli module (for command-line application) or the seed-web-undertow module (for embedded Web applications).

Parameters

Parameters should be given as system properties (-DparameterName=parameterValue):

Name Type Mandatory Description
capsuleVersion String No The capsule version to be used. If not given, the latest version discoverable is automatically used.
light - No If this parameter is specified (no value is necessary), a lightweight Capsule will be built instead of a standalone one. A lightweight Capsule will download its dependencies through Maven the first time it is run.
capsuleVersion String No The capsule version to be usedThe string of all arguments used to run the Seed application.
allowSnapshots - No If specified, the Capsule will allow SNAPSHOT dependencies to be used.

Examples

Standalone Capsule

A standalone Capsule packs all its dependencies and is completely self-contained. It is the default mode of operation. To build such a Capsule, use the following command:

mvn org.seedstack:seedstack-maven-plugin:package

Lightweight Capsule

A lightweight Capsule rely on Maven to download its dependencies the first time it is run. To build such a Capsule, use the following command:

mvn org.seedstack:seedstack-maven-plugin:package -Dlight

Note that you will need a fully configured Maven environment on the machine you want to the run a lightweight Capsule on. It is NOT recommended for production environment as it introduce a potential variability at execution time (should a dependency contents change for instance).

Running a capsule

To run a capsule, you simply execute it as a plain executable JAR:

java [jvm-args] -jar my-capsule.jar [args...]

You can specify any argument to the JVM or to the program as usual.

A lot of options can be specified to alter the default behavior of the Capsule itself. Please refer to the Capsule user-guide for more information.