[#packaging_types]
= Packaging Types (Uberjars & Hollow Jars)

When using WildFly Swarm, there are two different ways to package your
runtime and application, depending on how you intend to use and deploy
it.

[#uberjar]
== Uberjar

An _uberjar_ is a single Java `.jar` file that includes everything you need
to execute your application. This means both the runtime components
you have selected--you can understand that to as the app server-- along with
the application components (your `.war` file).

An uberjar is useful for many continuous integration and continuous deployment
(CI/CD) pipeline styles, in which a single executable binary artifact is produced
and moved through the testing, validation, and production environments in your
organization.

The names of the uberjars that WildFly Swarm produces include the name of your
application and the `-swarm.jar` suffix.

An uberjar can be executed like any executable JAR:

[source]
----
$ java -jar myapp-swarm.jar
----

[#hollow-jar]
== Hollow JAR

A _hollow JAR_ is similar to an uberjar, but includes only
the runtime components, and does not include your application code.

A hollow jar is suitable for deployment processes that involve Linux
containers such as Docker. When using containers,  place the runtime components
in a container image lower in the image hierarchy--which means it changes less
often--so that the higher layer which contains only your application code can
be rebuilt more quickly.

The names of the hollow JARs that WildFly Swarm produces include the name of
your application, and the `-hollowswarm.jar` suffix. You must package the
`.war` file of your application separately in order to benefit from the hollow
JAR.

Provide the application `.war` file as an argument to the Java binary when
executing the hollow JAR:

[source]
----
$ java -jar myapp-hollowswarm.jar myapp.war
----

