I'm currently dealing with the spring.handlers/spring.schemas problem described in the following defect
(quickly: maven jar-with-dependencies plugin is overwriting files with the same name from different jars, so that the last it adds wins. This means that when using spring dependencies some spring.handlers and spring.schemas files end up missing and you will get a runtime error such as "Configuration problem: Unalbe to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/p])
You can see that the second to bottom comment has a work around listed that I would like to use but I'm not sure how exactly to go about altering the assembly descriptor for a pre-defined assembly (jar-with-dependencies in this case) or if I can some how just add the specified exclusions to the plugin config in my pom.xml file
Joined: Aug 28, 2009
No thoughts? I'm reading a Maven book right now and the section on the assembly descriptor is about 35 pages and pretty abstruse. I'm unable to determine if my answer is even in there.
Perhaps that's why I've no responses.
Ok, I am not sure but you might be looking for something like this .... defining your own dependency set in the POM helps; that ways you explicitly provide the dependencies that you want; something like this
This is an example from a module we have which is used as a tool for injecting XMLs to our CMS; and it needs a lot of external and internal jars and war files during runtime. Another way can be to mention the dependencies in the assembly descriptor under the dependency set section.
Joined: Aug 28, 2009
Received an answer. Thanks.
From what I know, you can't "tweak" a pre-defined descriptor such as jar-with-dependencies, so you'll need to make your own assembly. The definition of jar-with-descriptors, if you want to use that as a base, is here:
To recap what we did in our project:
- manually locate the spring.handlers and spring.schemas files from all the Spring dependencies you're including in your project
- merge these to create two files, spring.handlers and spring.schemas, and place them in src/main/resources/META-INF
- exclude all the spring.handlers and spring.schemas *that come from JARs* using the code snippet from the JIRA issue in the assembly descriptor (this is the key bit)