Pages

Thursday, September 17, 2015

Maven Shade Plugin with Spring Applications

I recently came across multiple projects that use the Maven Shade Plugin to package Java applications into one big jar. Not that I think this is a particularly good idea, in fact I believe it's a terrible idea that may lead to somewhat unpredictable results. However, you sometimes have to live with what's already in place...

When I started using Spring in my applications another downside of this approach emerged: While all the tests passed just fine the packaged application failed to even start throwing somewhat unexpected exceptions like this: