在Jenkins v1.461上使用Maven 3命中org.apache.maven.lifecycle.LifecycleExecutionException

时间:2012-07-11 22:49:47

标签: jenkins maven-3 maven-failsafe-plugin

我正在尝试从Maven 2切换到Maven 3(v3.0.4)。正在使用的基本命令是jenkins上的mvn clean verify。

当我在jenkins上运行构建时,我在它的控制台上获得了以下堆栈跟踪:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE

<snip />

Waiting for Jenkins to finish collecting data
mavenExecutionResult exceptions not empty
message : Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.12:verify (default) on project myProject: There are test failures.

Please refer to /home/tc/.jenkins/jobs/myProject-selenium-adhoc/workspace/target/failsafe-reports for the individual test results.
cause : There are test failures.

Please refer to /home/tc/.jenkins/jobs/myProject-selenium-adhoc/workspace/target/failsafe-reports for the individual test results.
Stack trace : 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.12:verify (default) on project myProject: There are test failures.

Please refer to /home/tc/.jenkins/jobs/myProject-selenium-adhoc/workspace/target/failsafe-reports for the individual test results.
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:597)
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:98)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:64)
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 hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

Please refer to /home/tc/.jenkins/jobs/myProject-selenium-adhoc/workspace/target/failsafe-reports for the individual test results.
at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:121)
at org.apache.maven.plugin.failsafe.VerifyMojo.execute(VerifyMojo.java:208)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 27 more
Maven failed with error.
Sending e-mails to: person@org.com
channel stopped
2012-07-11 21:01:31.564:INFO::Shutdown hook executing
2012-07-11 21:01:31.564:INFO::Shutdown hook complete
Archiving artifacts
Sending e-mails to: person@org.com
Finished: SUCCESS

我已经尝试了很难在网上搜索,尝试各种pom更改并使用-e,-X,-fae等运行maven但似乎没有什么可以让我摆脱这个堆栈跟踪:( ...一直在努力w /它现在已经好几天了。

任何能够提供一些建议和/或针对解决问题的人都会非常感激。

请注意,该项目的安排如下:

Parent pom
|
----------> module 1
----------> module 2
----------> ...
----------> module 6

其中模块6对应于上面的myProject,它依赖于某些库(即module1,module2等)。

父母pom:

<reporting>
  <plugins>
      { several plugins including maven-dependency-plugin, maven-project-info-reports-plugin, cobertura-maven-plugin, maven-surefire-report-plugin (v2.12) 
       and maven-surefire-report-plugin (v2.12) specifically w/
        <reportSets>
          <reportSet>
            <id>integration-tests</id>
            <reports>
              <report>failsafe-report-only</report>
            </reports>
          </reportSet>
        </reportSets>
      }
  </plugins>
<reporting>

<build>
  <pluginManagement>
    <plugins>
        {several plugins including maven-surefire-plugin, maven-surefire-report-plugin (v2.12), maven-assembly-plugin, maven-release-plugin (v2.3.2)
    </plugins>
  </pluginManagement>
    <plugins>
        {several plugins including maven-site-plugin (v3.1), maven-compiler-plugin (v2.5.1), maven-release-plugin (v2.3.2)
    </plugins>
</build>

请注意,当测试失败时,我正好看到了问题,即我希望在测试失败时获得干净(没有堆栈跟踪等)控制台输出。事实上,在我上面提到的故障排除中,我实际上设置了(故意)失败的测试。此外,当我查看'/home/tc/.jenkins/jobs/myProject-selenium-adhoc/workspace/target/failsafe-reports'时,故障安全报告/测试失败详细信息输出看起来很好,即我看到我预期的测试失败屏幕截图(我们框架中的自定义逻辑)和各种摘要/报告,如emailable-report.html,内容正确。

谢谢!

0 个答案:

没有答案