Beware of Maven shading

Sometimes you get unwanted side-effects.

The maven-shade-plugin offers a great feature: to unpack all your dependencies (and repack) into a single über-jar that is self-contained for running a Java program.  

The idea isn’t new and the approach is employed by several frameworks, such as Spring Boot.  

There are however some things to watch out for, especially if you depend on the shaded artifact. As part of its transformation, the shade plugin will strip away the <dependencies> of your POM.

[Read More]