How to create single jar with dependencies using Maven

Many a times we have a need that we create a single jar with all the dependencies to ease of running. It’s quite easy to do so when using Maven. Let’s see how to create a single jar with all the dependencies.

Add the following to your pom.xml in build/ plugins section


This shall create a .one-jar.jar in the target folder

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.