
[id='creating-an-uberjar_{context}']
= Creating an uberjar

One method of packaging an application for execution
with {Thorntail} is as an _uberjar_.

[discrete]
== Prerequisites

* A Maven-based application with a `pom.xml` file.

[discrete]
== Procedure

. Add the `thorntail-maven-plugin` to your `pom.xml` in a `<plugin>` block,
  with an `<execution>` specifying the `package` goal.
+
[source,xml]
----
<plugins>
include::pom.xml[tag=plugin,indent=2]
</plugins>
----

. Perform a normal Maven build:
+
[source]
----
$ mvn package
----

. Execute the resulting uberjar:
+
[source]
----
$ java -jar ./target/myapp-thorntail.jar
----

