You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Keith Barlow (JIRA)" <ji...@codehaus.org> on 2009/10/13 01:30:26 UTC

[jira] Commented: (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.

    [ http://jira.codehaus.org/browse/MASSEMBLY-360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=194480#action_194480 ] 

Keith Barlow commented on MASSEMBLY-360:
----------------------------------------

I have been using Chris Wilkes workaround for this issue for a while now without a problem until today.  I happened to switch from the SpringSource Tool Suite 2.2.1 SR01 to Eclipse 3.5 SR01 at the end of last week and since doing so, the files from src/main/resources/META-INF do not seem to be the files getting placed in the jar-with-dependencies.  I need to narrow down which spring.handlers and spring.schemas are being used but they are not the ones I defined.  In fact, I can say that the versions in target/classes after the packaging is run are correct but the versions in the actual jar are not.  Is there a way to fix this?

I tried the following but the result was NO spring.handlers and spring.schemas files were in the resulting jar.:

<dependencySets>
    <dependencySet>
      <unpack>true</unpack>
      <unpackOptions>
      	<excludes>
      		<exclude>**/spring.handlers</exclude>
      		<exclude>**/spring.schemas</exclude>
      	</excludes>
      </unpackOptions>
      <scope>runtime</scope>
    </dependencySet>
  </dependencySets>
  <fileSets>
    <fileSet>
      <directory>${project.build.outputDirectory}</directory>
      <includes>
      	<include>META-INF/spring.handlers</include>
      	<include>META-INF/spring.schemas</include>
      </includes>
    </fileSet>
  </fileSets>

Thanks.

Keith

> When using mulitple Spring dependencies, the files from META-INF (from the Spring jars) overwrite each other in an executable jar-with-dependencies.
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MASSEMBLY-360
>                 URL: http://jira.codehaus.org/browse/MASSEMBLY-360
>             Project: Maven 2.x Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2-beta-2
>         Environment: Windows XP, Java 5
>            Reporter: Marielle Enderman
>
> 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:
> <dependency>
>    <groupId>org.springframework</groupId>
>     <artifactId>spring-beans</artifactId>
>     <version>2.5.5</version>
> </dependency>
> <dependency>
>     <groupId>org.springframework</groupId>
>     <artifactId>spring-context</artifactId>
>     <version>2.5.5</version>
> </dependency>
> 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 'http://www.springframework.org/schema/context/spring-context-2.5.xsd', 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 [http://www.springframework.org/schema/context]
> When I manually merge the files, the executable JAR file works fine. 
> I hope this problem can be solved. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira