我们有一个 TeamCity 构建配置,它使用 Maven Surefire 运行 Fitnesse 测试套件。经过一系列更改后,我们在尝试运行此配置时遇到以下异常:
[15:45:44][Step 2/2] [INFO] Final Memory: 45M/378M
[15:45:44][Step 2/2] [INFO] ------------------------------------------------------------------------
[15:45:44][Step 2/2] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project acceptance-test: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test failed: java.lang.RuntimeException: null,null,null,null,null: source is null -> [Help 1]
[15:45:44][Step 2/2] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project acceptance-test: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test failed: java.lang.RuntimeException: null,null,null,null,null
[15:45:44][Step 2/2] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
[15:45:44][Step 2/2] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[15:45:44][Step 2/2] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[15:45:44][Step 2/2] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
[15:45:44][Step 2/2] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
[15:45:44][Step 2/2] at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
[15:45:44][Step 2/2] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
[15:45:44][Step 2/2] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
[15:45:44][Step 2/2] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
[15:45:44][Step 2/2] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
[15:45:44][Step 2/2] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
[15:45:44][Step 2/2] at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
[15:45:44][Step 2/2] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[15:45:44][Step 2/2] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[15:45:44][Step 2/2] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[15:45:44][Step 2/2] at java.lang.reflect.Method.invoke(Method.java:601)
[15:45:44][Step 2/2] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
[15:45:44][Step 2/2] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
[15:45:44][Step 2/2] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
[15:45:44][Step 2/2] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[15:45:44][Step 2/2] Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test failed: java.lang.RuntimeException: null,null,null,null,null
[15:45:44][Step 2/2] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
[15:45:44][Step 2/2] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
[15:45:44][Step 2/2] ... 19 more
[15:45:44][Step 2/2] Caused by: java.lang.RuntimeException: java.lang.RuntimeException: null,null,null,null,null
[15:45:44][Step 2/2] at org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer.close(ThreadedStreamConsumer.java:123)
[15:45:44][Step 2/2] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:463)
[15:45:44][Step 2/2] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:352)
[15:45:44][Step 2/2] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:158)
[15:45:44][Step 2/2] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:958)
[15:45:44][Step 2/2] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:822)
[15:45:44][Step 2/2] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:720)
[15:45:44][Step 2/2] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
[15:45:44][Step 2/2] ... 20 more
[15:45:44][Step 2/2] Caused by: java.lang.RuntimeException: null,null,null,null,null
[15:45:44][Step 2/2] at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.createReportEntry(ForkClient.java:210)
[15:45:44][Step 2/2] at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkClient.java:105)
[15:45:44][Step 2/2] at org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.run(ThreadedStreamConsumer.java:67)
[15:45:44][Step 2/2] at java.lang.Thread.run(Thread.java:722)
[15:45:44][Step 2/2] Caused by: java.lang.NullPointerException: source is null
[15:45:44][Step 2/2] at org.apache.maven.surefire.report.SimpleReportEntry.<init>(SimpleReportEntry.java:58)
[15:45:44][Step 2/2] at org.apache.maven.surefire.report.CategorizedReportEntry.reportEntry(CategorizedReportEntry.java:57)
[15:45:44][Step 2/2] at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.createReportEntry(ForkClient.java:206)
[15:45:44][Step 2/2] ... 3 more
有谁知道这个异常的可能原因?我确信这与我们的代码有关,而不是与正在使用的工具有关(因为我可以很好地构建以前的提交集),但是工作构建和失败构建之间的更改不应该对这个集合产生任何影响的测试。此外,针对在 TeamCity 上失败的提交在本地运行相同的 maven 命令(mvn clean package -U -X)可以很好地完成。
此异常是使用 -X Maven 标志生成的 - 有没有办法获得有关所导致异常的更详细信息?
我们正在使用带有 Surefire 插件 2.16 的 Maven 3.0.5