Copying dependencies with Maven

In a previous post I put here how to create fat jars using Maven, now Let’s see how to copy the necessary dependencies, setup the classpath and execute the jar without unpacking any of the dependencies.

To do this we’ll need two plugins :



maven-jar-plugin is the one that will create and configure META-INF/MANIFEST.MF containing the main class and all the related dependencies.

maven-dependency-plugin will pickup and put all the dependencies in the right place.

Let’s take a look.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""



      <!-- Dependencies -->


Using this configuration, all our dependencies will be placed into /lib folder and the jar will be created in the same folder level, ready to be executed.

Allan de Queiroz

Allan de Queiroz
London based software engineer

XServer forward from Linux text mode for Headless purposes.

Hello, this post is about XServer forward from Linux text mode, **not ssh forward, anything related to VNC** or things like that.Recently...… Continue reading