Deploying Maven project throws java.util.zip.ZipException: invalid LOC header (bad signature)

前端 未结 14 2041
予麋鹿
予麋鹿 2020-11-22 08:03

I am getting the below exception when I run my mvn install. I have even deleted the local repository and ran again getting same exception.

<
14条回答
  •  心在旅途
    2020-11-22 08:50

    From gsitgithub/find-currupt-jars.txt, the following command lists all the corrupted jar files in the repository:

    find  /home/me/.m2/repository/ -name "*jar" | xargs -L 1 zip -T | grep error | grep invalid
    

    You can delete the corrupted jar files, and recompile the project.

    Example output:

    warning [/cygdrive/J/repo/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar]:  98304 extra bytes at beginning or within zipfile
      (attempting to process anyway)
    file #1:  bad zipfile offset (local header sig):  98304
      (attempting to re-compensate)
    zip error: Zip file invalid, could not spawn unzip, or wrong unzip (original files unmodified)
    

提交回复
热议问题