Runnable Jar using Maven with dependancy

Maven is a great tool when it come to repetitive task. Exporting a runnable jar with maven can be done thanks to the maven-assembly-plugin

Edit your pom.xml file and add the plugin


Replace com.yourcompany.yourMainClass by the name of your entry point class who implement public static void main(String[] args)

Running the command “mvn clean install” will generate in the target/ directory a runnable call *YOUR_JAR_NAME*-jar-with-dependencies.jar who embed all it dependancy and the generated /META-INF/MANIFEST.MF file