Maven packaging failed invalid LOC header (bad signature)

Maven failed to build the package and reported the following error:

Error creating shaded jar: invalid LOC header (bad signature) -> [ Help 1]

At the beginning, the replacement of the higher version of Maven plugin failed again. However, the error report is more detailed, indicating the problematic jar package: /MNT/D/develop/mavenrepo/COM/Alibaba/fastjson/1.2.44/fastjson-1.2.44. Jar

[INFO] BUILD FAILURE  
[INFO] ------------------------------------------------------------------------  
[INFO] Total time: 32.235 s  
[INFO] Finished at: 2019-11-28T20:46:18+08:00  
[INFO] Final Memory: 56M/720M  
[INFO] ------------------------------------------------------------------------  
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.1.1:shade (default) on project flink-base: Error creating shaded jar: Problem shading JAR /mnt/d/Develop/mavenRepo/com/alibaba/fastjson/1.2.44/fastjson-1.2.44.jar entry META-INF/services/org.glassfish.jersey.internal.spi.AutoDiscoverable: java.util.zip.ZipException: invalid LOC header (bad signature) -> [Help 1]
[ERROR]   
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.  
[ERROR] Re-run Maven using the -X switch to enable full debug logging.    
[ERROR]   
[ERROR] For more information about the errors and possible solutions, please read the following articles:  
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException  

You can also run MVN – e package and MVN – x package on the command line under the project directory folder according to the prompt, and I see that specific error messages will be printed on the Internet to point out the problematic jar packages. However, it takes too much time to download all jar packages again, so I didn’t try.

Then enter the directory,/MNT/D/develop/mavenrepo/COM/Alibaba/fastjson/1.2.44 /, and find that there is a aether-fb0089ce-dff1-4256-9ccc-a2bb768c48f7-fastjson-1.2.44.jar.sha1-in-progress file in it. Delete all files in the directory and repackage. Success!

Summary: this problem is also the cause of Maven’s error in downloading jar. Most of the problems encountered are the cause of Maven’s error in downloading jar package.

Similar Posts: