antzip7zipantbuilder

How to resolve 7-zip's 'Warnings: Headers Error' from .zip created by Ant build?


I have code for creating zip file in ant build script.

<target name="zip-dist" description="archiving artifacts">
    <zip destfile="${artifacts}/${zipfile}.zip" update="false" basedir="${target.dist}" includes="*.xyz-*" />
</target>

When file is being extracted using win zip right click -> Extract All... there's no warning, but while extracting with 7-zip showing 'Warnings: Headers Error' but its successful.

I know this has no effect on the output as its just a warning so suggested users to ignore it or use win-zip method.

But trust me it is impossible to make them understand and they all are keep on eating my head. There are many users and I am banging my head repeating same thing again and again. Still they want it to be fixed.

Can I use any attribute in ant-zip target or should I use any different zipping technique in ant build?

I have searched multiple online sources, this is last hope! Please help.


Solution

  • I had the same issue.
    Fixed adding only one attribute, to force Zip64 extensions:

    <zip zip64Mode="always" ..... />
    

    Try and should work for you too.