How to package your application

Hammock deviates from standard Java EE by encouraging the use of 'uber-jar’s, where all of your dependencies are packaged with your application. Hammock projects can be packaged using shaded JARs, but those tend to lead to very large single JARs and become hard to follow. It is highly recommended to use Capsule to package your applications. This leaves your JARs in tact and not mixed together with the libraries packaged along side them.

Example Maven Configuration

The below is an example maven project that can be used to package your application using Capsule

<project xmlns=""

This uses the base MicroProfile distribution from Hammock. It registers the main method from ws.ament.hammock.Boostrap and sets up the build as a fat JAR, all of the packages will be in the JAR and nothing will be downloaded at runtime. Capsule has a few other configurations you may want to try. The results of this build gives you a file named my-service-1.0-SNAPSHOT-capsule.jar in your target folder, which will be about 13 mb in size. Not too bad.