You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Scott Battaglia (JIRA)" <ji...@codehaus.org> on 2009/05/21 17:05:42 UTC

[jira] Created: (MASSEMBLY-412) Assembly corrupts images when placing them in ZIP file

Assembly corrupts images when placing them in ZIP file
------------------------------------------------------

                 Key: MASSEMBLY-412
                 URL: http://jira.codehaus.org/browse/MASSEMBLY-412
             Project: Maven 2.x Assembly Plugin
          Issue Type: Bug
    Affects Versions: 2.2-beta-3
            Reporter: Scott Battaglia
         Attachments: bad_ja-sig-logo.gif, ja-sig-logo.gif

I've noticed this with previous versions of the plugin (i.e. Beta 1), but I'm still seeing it with Beta 3.  When I build my assembly, some of the images in the webapp module are being corrupted.  I'll attach the image (note, that in the included .WAR file the images are fine).  The bad one is prefixed with bad.

You can try this yourself.  Our code is publicly available at:
https://www.ja-sig.org/svn/cas3/trunk

Thanks
Scott

-- 
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

        

[jira] Commented: (MASSEMBLY-412) Assembly corrupts images when placing them in ZIP file

Posted by "Scott Battaglia (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MASSEMBLY-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=180665#action_180665 ] 

Scott Battaglia commented on MASSEMBLY-412:
-------------------------------------------

Thanks, that seemed to have done the trick!  Not completely obvious though!

> Assembly corrupts images when placing them in ZIP file
> ------------------------------------------------------
>
>                 Key: MASSEMBLY-412
>                 URL: http://jira.codehaus.org/browse/MASSEMBLY-412
>             Project: Maven 2.x Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2-beta-3
>            Reporter: Scott Battaglia
>         Attachments: bad_ja-sig-logo.gif, ja-sig-logo.gif
>
>
> I've noticed this with previous versions of the plugin (i.e. Beta 1), but I'm still seeing it with Beta 3.  When I build my assembly, some of the images in the webapp module are being corrupted.  I'll attach the image (note, that in the included .WAR file the images are fine).  The bad one is prefixed with bad.
> You can try this yourself.  Our code is publicly available at:
> https://www.ja-sig.org/svn/cas3/trunk
> Thanks
> Scott

-- 
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

        

[jira] Closed: (MASSEMBLY-412) Assembly corrupts images when placing them in ZIP file

Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MASSEMBLY-412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Casey closed MASSEMBLY-412.
--------------------------------

    Resolution: Won't Fix
      Assignee: John Casey

avoid lineEnding and filtering when handling binary files. This is the same as with the maven-resources-plugin, used by default to build a 'jar' packaging project.

> Assembly corrupts images when placing them in ZIP file
> ------------------------------------------------------
>
>                 Key: MASSEMBLY-412
>                 URL: http://jira.codehaus.org/browse/MASSEMBLY-412
>             Project: Maven 2.x Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2-beta-3
>            Reporter: Scott Battaglia
>            Assignee: John Casey
>         Attachments: bad_ja-sig-logo.gif, ja-sig-logo.gif
>
>
> I've noticed this with previous versions of the plugin (i.e. Beta 1), but I'm still seeing it with Beta 3.  When I build my assembly, some of the images in the webapp module are being corrupted.  I'll attach the image (note, that in the included .WAR file the images are fine).  The bad one is prefixed with bad.
> You can try this yourself.  Our code is publicly available at:
> https://www.ja-sig.org/svn/cas3/trunk
> Thanks
> Scott

-- 
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

        

[jira] Commented: (MASSEMBLY-412) Assembly corrupts images when placing them in ZIP file

Posted by "Dave Hallam (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MASSEMBLY-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=180613#action_180613 ] 

Dave Hallam commented on MASSEMBLY-412:
---------------------------------------

Hi Scott,

Came across this posting as I've just had the same issue, except that it was corrupting a java class file and a zip file.  

But I have figured out what the problem was.  In the distribution.xml file, I had the following:

{noformat}
        <fileSet>
            <directory>config</directory>
            <lineEnding>unix</lineEnding>
            <fileMode>0744</fileMode>
            <includes>
                <include>**</include>
            </includes>
            <outputDirectory>/myapp/config</outputDirectory>
        </fileSet>
{noformat}

The problem is that the lineEnding feature appears to scan binary files for an EOL sequence of bytes and replaces them.  So if that sequence appears in your binary file, it corrupts it.

The solution is to either remove the lineEnding configuration or to split the fileset into two - one that deals with text files and the other that deals with binary.

Hope that sorts you out.

Regards,

Dave

> Assembly corrupts images when placing them in ZIP file
> ------------------------------------------------------
>
>                 Key: MASSEMBLY-412
>                 URL: http://jira.codehaus.org/browse/MASSEMBLY-412
>             Project: Maven 2.x Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2-beta-3
>            Reporter: Scott Battaglia
>         Attachments: bad_ja-sig-logo.gif, ja-sig-logo.gif
>
>
> I've noticed this with previous versions of the plugin (i.e. Beta 1), but I'm still seeing it with Beta 3.  When I build my assembly, some of the images in the webapp module are being corrupted.  I'll attach the image (note, that in the included .WAR file the images are fine).  The bad one is prefixed with bad.
> You can try this yourself.  Our code is publicly available at:
> https://www.ja-sig.org/svn/cas3/trunk
> Thanks
> Scott

-- 
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

        

[jira] Commented: (MASSEMBLY-412) Assembly corrupts images when placing them in ZIP file

Posted by "Dave Hallam (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MASSEMBLY-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=180618#action_180618 ] 

Dave Hallam commented on MASSEMBLY-412:
---------------------------------------

Hi Scott,

I've just tried to comment on this issue but it appeared not to be stored so this is the second time!!

I came across your issue when I encountered the same problem where it corrupted a zip and a class file.

I solved it by changing the distribution.xml file.  It used to be:

{noformat}
        <fileSet>
            <directory>config</directory>
            <lineEnding>unix</lineEnding>
            <fileMode>0744</fileMode>
            <includes>
                <include>**</include>
            </includes>
            <outputDirectory>/myapp/config</outputDirectory>
        </fileSet>
{noformat}

The problem seems to be that the lineEnding tag searches for an EOL sequence and, if your binary contains that sequence, it's replaces with whatever you have asked for - thus corrupting the file.  Solution, remove the lineEnding config line, or split the fileSet into two fileSets - one for text and the other for binary files.

Hope that helps.

Dave


> Assembly corrupts images when placing them in ZIP file
> ------------------------------------------------------
>
>                 Key: MASSEMBLY-412
>                 URL: http://jira.codehaus.org/browse/MASSEMBLY-412
>             Project: Maven 2.x Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2-beta-3
>            Reporter: Scott Battaglia
>         Attachments: bad_ja-sig-logo.gif, ja-sig-logo.gif
>
>
> I've noticed this with previous versions of the plugin (i.e. Beta 1), but I'm still seeing it with Beta 3.  When I build my assembly, some of the images in the webapp module are being corrupted.  I'll attach the image (note, that in the included .WAR file the images are fine).  The bad one is prefixed with bad.
> You can try this yourself.  Our code is publicly available at:
> https://www.ja-sig.org/svn/cas3/trunk
> Thanks
> Scott

-- 
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