Jenkins 未显示 maven 编译器错误故障 排除解决 方案
在 Jenkins 中构建我们的多模块 maven 3 项目时,如果出现构建错误,我们会收到一条神秘的消息,指出 maven 编译器插件失败。这才在上周才刚刚开始发生:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11:22.340s
[INFO] Finished at: Fri Feb 10 09:44:02 CET 2012
[INFO] Final Memory: 171M/318M
[INFO] ------------------------------------------------------------------------
mavenExecutionResult exceptions not empty
message : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project me.activity.impl: Compilation failure
cause : Compilation failure
Stack trace :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project me.activity.impl: Compilation failure
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.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:104)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:287)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 27 more
Maven schlug mit Fehlern fehl.
An attempt to send an e-mail to empty list of recipients, ignored.
从命令行构建时,我们会收到正常的构建错误:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5:24.906s
[INFO] Finished at: Fri Feb 10 08:17:31 EST 2012
[INFO] Final Memory: 173M/328M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project me.activity.impl: Compilation failure: Compilation failure:
[ERROR] \p4views\VM\Base\main\modules\activity\impl\src\main\java\com\sap\me\activity\impl\ExtensionConfigurationService.java:[1018,12] cannot find symbol
[ERROR] symbol : class ActivityRuntimeType
[ERROR] location: class com.sap.me.activity.impl.ExtensionConfigurationService
[ERROR] \p4views\VM\Base\main\modules\activity\impl\src\main\java\com\sap\me\activity\impl\ExtensionConfigurationService.java:[200,16] cannot find symbol
[ERROR] symbol : class ActivityRuntimeType
[ERROR] location: class com.sap.me.activity.impl.ExtensionConfigurationService
[ERROR] \p4views\VM\Base\main\modules\activity\impl\src\main\java\com\sap\me\activity\impl\ExtensionConfigurationService.java:[234,16] cannot find symbol
[ERROR] symbol : class ActivityRuntimeType
[ERROR] location: class com.sap.me.activity.impl.ExtensionConfigurationService
[ERROR] \p4views\VM\Base\main\modules\activity\impl\src\main\java\com\sap\me\activity\impl\ExtensionConfigurationService.java:[263,16] cannot find symbol
[ERROR] symbol : class ActivityRuntimeType
[ERROR] location: class com.sap.me.activity.impl.ExtensionConfigurationService
[ERROR] \p4views\VM\Base\main\modules\activity\impl\src\main\java\com\sap\me\activity\impl\ExtensionConfigurationService.java:[294,20] cannot find symbol
[ERROR] symbol : class ActivityRuntimeType
[ERROR] location: class com.sap.me.activity.impl.ExtensionConfigurationService
[ERROR] \p4views\VM\Base\main\modules\activity\impl\src\main\java\com\sap\me\activity\impl\ExtensionConfigurationService.java:[311,16] cannot find symbol
[ERROR] symbol : class ActivityRuntimeType
[ERROR] location: class com.sap.me.activity.impl.ExtensionConfigurationService
[ERROR] \p4views\VM\Base\main\modules\activity\impl\src\main\java\com\sap\me\activity\impl\ExtensionConfigurationService.java:[1023,47] cannot find symbol
[ERROR] symbol : variable ActivityRuntimeType
[ERROR] location: class com.sap.me.activity.impl.ExtensionConfigurationService
[ERROR] \p4views\VM\Base\main\modules\activity\impl\src\main\java\com\sap\me\activity\impl\ExtensionConfigurationService.java:[1025,67] cannot find symbol
[ERROR] symbol : variable ActivityRuntimeType
[ERROR] location: class com.sap.me.activity.impl.ExtensionConfigurationService
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :me.activity.impl
我们在本地构建和 Jenkins 上使用 maven-3.0.4。Jenkins 版本是 1.3ish,但我升级到了 1.450,看看问题是否会消失 - 它没有。这发生在我们从 maven-2.2.1 迁移到 maven-3.0.4 的时候,但我可以发誓(尽管我没有证据)在 maven 升级后,我在 Jenkins 上遇到了正常的构建错误,所以我认为不是这样,但这是我能想到的唯一会导致这种情况的变化。编译器插件版本为 2.0.2。
我在这里看到了类似的帖子,但他的问题与eclipse构建有关,而不是Jenkins。