Maven Assembly Plugin
  1. Maven Assembly Plugin
  2. MASSEMBLY-360

When using mulitple Spring dependencies, the files from META-INF (from the Spring jars) overwrite each other in an executable jar-with-dependencies.


    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2-beta-2
    • Fix Version/s: 2.2
    • Component/s: None
    • Labels:
    • Environment:
      Windows XP, Java 5


      I'm working on a Java 5 project with maven 2 and I need to deliver an executable jar file. In this project I'm using different Spring dependencies:

      For maven packaging I'm using the maven-assembly plugin to create an executable jar with dependencies (using the jar-with-dependencies descriptor). Everything works fine, except that Spring's XSD files can't be found. At least: not all of them. The fact is: Every Spring JAR file contains a META-INF directory with files like spring.handlers and spring.schemas which contain list of locations of respectively namespace handlers and schemas. Unfortunately these files aren't merged during packaging so the META_INF of the executable JAR file only contains the last one added.

      This can result in errors like this:

      Example 1: The spring-context-2.5.xsd can't be found:
      WARN org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Ignored XML validation warning org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document '', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

      Example 2: The NamespaceHandler for the spring context namespace can't be located:
      Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace

      When I manually merge the files, the executable JAR file works fine.
      I hope this problem can be solved.


        No work has yet been logged on this issue.


          • Assignee:
            John Casey
            Marielle Enderman
          • Votes:
            22 Vote for this issue
            20 Start watching this issue


            • Created: