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
interface in their classpath, like the one provided by the
seed-cli module (for command-line application) or the
module (for embedded Web applications).
Parameters should be given as system properties (
|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.|
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:
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.