When you use eclipse to package maven projects, the invalid LOC header (bad signature) exception is reported. eclipsemaven
When packaging on eclipse, an error is returned:
[INFO] Including org.codehaus.groovy:groovy-all:jar:2.4.3 in the shaded jar.[INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time: 8.269 s[INFO] Finished at: 2017-11-06T11:08:57+08:00[INFO] Final Memory: 62M/644M[INFO] ------------------------------------------------------------------------[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.4.3:shade (default) on project com.project.name: Error creating shaded jar: 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
Run the mvn-X package in the project directory as prompted, and print the detailed stack information:
[DEBUG] Processing JAR H:\apache-maven-3.3.9\repository\org\apache\parquet\parquet-jackson\1.7.0\parquet-jackson-1.7.0.jar[INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time: 43.299 s[INFO] Finished at: 2017-11-06T11:35:18+08:00[INFO] Final Memory: 33M/759M[INFO] ------------------------------------------------------------------------[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.4.3:shade (default) on project com.project.name: Error creating shaded jar: invalid LOC header (bad signature) -> [Help 1]org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.4.3:shade (default) on project com.project.name: Error creating shaded jar: invalid LOC header (bad signature) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarte
See the last DEBUG information, find the corresponding directory "H: \ apache-maven-3.3.9 \ repository \ org \ apache \ parquet-jackson \ 1.7.0 \", found. the sha1-in-progress end of the file, indicating that the jar is not properly downloaded, delete and re-execute, while observing the directory can be:
The prompt is as follows:
The download is normal. The corresponding directory is:
It is normal. (If you find that the progress bar is halfway through, you can stop deleting it and try again. In addition, the domestic maven library using aliyun is much faster)
Summary:
When the invalid LOC header (bad signature) appears, follow the prompts to take-X to execute mvn find,. sha1-in-progress to delete, re-execute.