maven error invalid LOC header(bad signature)

Keywords: Maven Spring Apache xml

The following error was reported when executing mvn package on the command line

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project bonus-notice-webapp: Compilation failure
[ERROR] Failure executing javac, but could not parse the error:
[ERROR] error: read D:\dev-tool\maven-repository\org\springframework\boot\spring-boot\1.4.2.RELEASE\spring-boot-1.4.2.RELEASE.jar Error occurred; invalid LOC header (bad signature)
[ERROR] error: read D:\dev-tool\maven-repository\org\springframework\boot\spring-boot-autoconfigure\1.4.2.RELEASE\spring-boot-autoconfigure-1.4.2.RELEASE.jar Error occurred; invalid CEN header (bad signature)
[ERROR] error: read D:\dev-tool\maven-repository\org\springframework\spring-core\4.3.4.RELEASE\spring-core-4.3.4.RELEASE.jar Error occurred; invalid CEN header (bad signature)
[ERROR] error: read D:\dev-tool\maven-repository\org\springframework\spring-context\4.3.4.RELEASE\spring-context-4.3.4.RELEASE.jar Error occurred; invalid LOC header (bad signature)
[ERROR] error: read D:\dev-tool\maven-repository\org\apache\tomcat\embed\tomcat-embed-core\8.5.6\tomcat-embed-core-8.5.6.jar Error occurred; invalid LOC header (bad signature)
[ERROR] error: read D:\dev-tool\maven-repository\com\fasterxml\jackson\core\jackson-databind\2.8.4\jackson-databind-2.8.4.jar Error occurred; invalid CEN header (bad signature)
[ERROR] error: read D:\dev-tool\maven-repository\org\springframework\spring-web\4.3.4.RELEASE\spring-web-4.3.4.RELEASE.jar Error occurred; invalid LOC header (bad signature)
[ERROR] error: read D:\dev-tool\maven-repository\org\springframework\spring-beans\4.3.4.RELEASE\spring-beans-4.3.4.RELEASE.jar Error occurred; invalid LOC header (bad signature)
[ERROR] error: read D:\dev-tool\maven-repository\org\springframework\spring-webmvc\4.3.4.RELEASE\spring-webmvc-4.3.4.RELEASE.jar Error occurred; invalid LOC header (bad signature)
[ERROR] error: read D:\dev-tool\maven-repository\com\alibaba\dubbo\2.8.5\dubbo-2.8.5.jar Error occurred; invalid LOC header (bad signature)
[ERROR] error: read D:\dev-tool\maven-repository\org\apache\zookeeper\zookeeper\3.4.8\zookeeper-3.4.8.jar Error occurred; invalid LOC header (bad signature)
[ERROR] error: read D:\dev-tool\maven-repository\org\apache\velocity\velocity\1.7\velocity-1.7.jar Error occurred; invalid CEN header (bad signature)
[ERROR] error: read D:\dev-tool\maven-repository\com\minshenglife\minshenglife-framework-commons\2.0.2\minshenglife-framework-commons-2.0.2.jar Error occurred; invalid LOC header (bad signature)
[ERROR] error: read D:\dev-tool\maven-repository\org\apache\commons\commons-lang3\3.5\commons-lang3-3.5.jar Error occurred; invalid LOC header (bad signature)
[ERROR] error: read D:\dev-tool\maven-repository\io\netty\netty-all\4.0.36.Final\netty-all-4.0.36.Final.jar Error occurred; invalid LOC header (bad signature)
[ERROR] [A total of 144 milliseconds]
[ERROR] 15 A mistake
[ERROR] -> [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/MojoFailureException


Solution
Change the maven user profile in the IDE used
If you use eclipse, modify maven's settings.xml in preferences (add private service repository). When compiling, run as -- maven... -- input package to run, and then compile successfully.


If you use Intellij IDEA, it is also in settings to modify the Maven configuration file settings. XML (increase private service warehouse), compile, in "maven projects" in the lifecycle select "package"
Then run the compilation. This will also compile successfully.
If you enter the mvn package directly from the command line, the Maven configuration running is the Maven unified configuration of the system, not the settings.xml that is currently needed (e.g. C: dev mvn apache-maven-3.3.1 conf mslife mssettings.xml)
Therefore, the above error will be reported.


The IntelliJ IDEA interface is as follows




Posted by febrarian on Wed, 06 Feb 2019 22:45:16 -0800