Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


creating an uber jar with spring dependencies


creating an uber jar with spring dependencies  using -'spring,executable-jar'

I'm trying to create an application √ľber jar, but running into an issue due to a dependency on the spring framework. ¬†In particular, the namespaces for the xml schemas are problematic. ¬†You get the infamous NamespaceHandler problem:

Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/c]


For creating (simple) uber jars, Creating a bundle jar with ant, but this doesn't work if you have spring dependencies due to the fact that the spring jars have files such as spring.handlers, spring.schemas and spring.tooling in the META-INF directories of many of their jar files. The namespace resolution is dependent, I believe, on these files.

The √ľber jar seems to somehow contain all necessary files, but I'm guessing the runtime is seeing only one.

For example, a jar -tf of my uber jar shows (in part)

META-INF/spring.handlers
META-INF/spring.schemas
META-INF/spring.tooling
META-INF/license.txt
META-INF/notice.txt
META-INF/spring.factories
META-INF/spring.handlers
META-INF/spring.schemas
META-INF/spring.tooling
META-INF/license.txt
META-INF/notice.txt
META-INF/license.txt
META-INF/notice.txt
META-INF/spring.handlers
META-INF/spring.schemas
META-INF/spring.tooling
META-INF/license.txt
META-INF/notice.txt
META-INF/license.txt


So: question.. is there a way to create an uber-jar that has the spring jars bundled inside?  Do I need to merge the META-INF files?  Anyone have experience doing file merger with ant builds?
    

asked Oct 6, 2015 by abhi
0 votes
15 views



Related Hot Questions



Government Jobs Opening


...