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

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

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.

Gradle Spring Woes: Issues in creating single jar bundle with all dependency jars nested within

If you’re implementing any projects with Spring and Gradle (for build), as your project grows you may run into this issue. Or you’ve landed on this page by searching on Google for “Unable to locate Spring NamespaceHandler for XML schema namespace” (your actual XML that it’s error-ing out may vary). Either way, you’re in luck! Most likely, you’re using the fatjar gradle plugin to create a single JAR for executing as “java -jar one-big-bundle.