How to use maven shade plugin to create fat jar

In this post I will show how to use maven's shade plugin to create fat jar also known as a uber jar or jar with dependencies that contains not only a Java program, but embeds its dependencies as well. Here I have use maven version 3.2.4. Below is the full configuration I used to create fat jar for projects. I hope you find it helpful. 

</plugin> NOTE: <mainClass> Fully qualified name of your main class </mainClass>.
A fully-qualified class name in Java contains the package that the class originated from.
An example of this is java.util.Arraylist.