spring.schemas and spring.handlers when creating Uber-Jar | MyThinkPond

When creating an uber-jar with all dependencies in one single-jar file, each of the spring dependency jar may contain schema and handlers that have the same name but different content. When you combine them into creating a single uber-jar, the uber-library will perform an overwrite since each of the Spring files for schema and handlers are the exact filename. So you end up overwriting the file where the last ubered file will remain.

The following shows you how to leverage the Maven-Shade-Plugin in Maven to retain all versions of the file by appending the content into one single file for both spring.handlers and spring.schemas.

 1 2 3 4 5 6 7 8 91011121314151617181920212223
                        <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                        <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
Venkatt Guhesan avatar
About Venkatt Guhesan
Enterprise Software Architect currently working at DataDirect Networks developing a highly scalable monitoring solution called DDN Insight. My passions include all things Open Source including Linux (CentOS, Red Hat, Gentoo, Open Stack, Docker & Ubuntu), embedded ARM processors and microcontrollers (Arduino, UDOO, Cubieboard, BeagleBoard, OnionIO, TI's Zigbee). Coming from an Electrical and Computer Engineering background, working in developing and designing enterprise - distributed, highly scalable software requires a unique set of software skills with a good understanding of the hardware. This makes his work challenging and interesting. In his free time, he spends his time with his family and two children. He also enjoys researching on topics including - world ancient history and yoga. Visit the 'About' section for more details.
comments powered by Disqus