(blog-of ‘Alex’)

My blog about software development and other things

How to create standalone JAR using maven?

After getting stuck several times with maven assembly plugin I decided to make a note on how to create standalone jar with maven.

Standalone jar allows you to easily distribute your application within single JAR by packing all your dependencies into one. Standalone JAR can be started without specifying extra classpaths.

Here is the sample configuration that does the trick:

        <!-- Packaging configuration -->

Once you have similar configuration for your app, you can create standalone jar via mvn clean package assembly:assembly.