本文介绍了maven2 中的编译错误:“无效的 CEN 标头(错误的签名)"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在迁移我们的 java-ee 项目以使用 Maven 而不是 Ant.
I'm migrating our java-ee project to use Maven instead of Ant.
对于以下依赖
<dependency>
<groupId>javolution</groupId>
<artifactId>javolution</artifactId>
<version>5.4.2</version>
</dependency>
尝试编译时出现以下错误
I get the following error when trying to compile
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.
3.2:compile (default-compile) on project JAdaptiv: Compilation failure
[ERROR] error: error reading C:UsersUser.IVSTEL1.m2
epositoryjavolution
javolution5.4.2javolution-5.4.2.jar; invalid CEN header (bad signature)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on
project JAdaptiv: Compilation failure
error: error reading C:UsersUser.IVSTEL1.m2
epositoryjavolutionjavoluti
on5.4.2javolution-5.4.2.jar; invalid CEN header (bad signature)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:213)
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.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation fail
ure
error: error reading C:UsersCroydon.IVSTEL1.m2
epositoryjavolutionjavoluti
on5.4.2javolution-5.4.2.jar; invalid CEN header (bad signature)
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompiler
Mojo.java:656)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:209)
... 19 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption
推荐答案
这意味着您本地存储库中的 javolution-5.4.2 jar 已损坏.我在这个 link.您可以手动将 jar 从那里复制到本地存储库,看看是否有帮助.
You can also try the following steps:-
- Delete the jar from your local repository
C:UsersUser.IVSTEL1.m2epositoryjavolutionjavolution5.4.2javolution-5.4.2.jar
. Then maven will download it again for you. If the 5.4.2 version still has some issues after re-download then try the following version.
<groupId>javolution</groupId><artifactId>javolution</artifactId><version>5.5.1</version></dependency>
这篇关于maven2 中的编译错误:“无效的 CEN 标头(错误的签名)"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!