Creating Uber jars with maven

In this quick tip, let’s take a look at how to create Uber jars with maven.

Uber jars or Fat jars, are quite useful, especially when we’re creating self-contained and executable applications that we’re planning to distribute and make it useful with less effort possible.

A good option to do this is using Apache Maven Assembly Plugin. Let’s take a look in the example below.

Here we’re creating a jar that contains all the dependencies “jar-with-dependencies” ready to be executed, we just need to specify the mainClass to be set into META-INF/MANIFEST.MF and build it.

That’s it, simple and useful 🙂

Leave a Reply