2

We are using maven Assembly and Dependency plugin to share resources across sub-modules, as described in this post, http://www.sonatype.com/people/2008/04/how-to-share-resources-across-projects-in-maven/

While the text files like property files are getting unpacked properly, files in binary mode (e.g. pdf files) are getting corrupted while the dependency plugin unpacks them.

We have narrowed down the issue to dependency plugin (unpacking stage) by validating the archive (zip) created by the assembly plugin

Any help on this would help a lot

Deepan
  • 559
  • 3
  • 13
  • 1
    Which version of maven-assembly and maven-dependency plugin are you using? – khmarbaise Dec 14 '11 at 13:33
  • @khmarbaise we are using version 2.2-beta-2 of maven-assembly plugin and version 2.0 of maven-dependency plugin – Deepan Dec 14 '11 at 15:55
  • Update the maven-assembly-plugin to 2.2.2 whereas the maven-dependency-plugin to 2.4....and take a look into the changelog of the maven dependency plugin... – khmarbaise Dec 14 '11 at 16:03
  • @khmarbaise the version update did not solve the issue. And found that even a jar file gets corrupted while unpacking. And such corrupted files roughly result in twice the size of the original files – Deepan Dec 14 '11 at 16:37
  • Can you share the relevant pom snippet which does this? – Raghuram Dec 15 '11 at 11:50

2 Answers2

1

Using lineEnding or fileMode in your assembly.xml for binary files will cause them to be corrupted - if you are applying either of these on your text resources make sure you use a separate fileSet for binary resources.

http://jira.codehaus.org/browse/MASSEMBLY-412

Ray M
  • 329
  • 1
  • 4
-1

For those who will encounter similar problem, I found solution in this answer: https://stackoverflow.com/a/24282250/2211974

Simply verify if maven is not filtering your binary file, and in case it is add configuration to maven-resource-plugin:

<configuration>
    <nonFilteredFileExtensions>
        <nonFilteredFileExtension>bin</nonFilteredFileExtension>
    </nonFilteredFileExtensions>
</configuration>
kryski
  • 414
  • 2
  • 6
  • 18