这让我发疯。Maven 故障保护插件不会在我的项目上运行。如果我mvn verify
只运行肯定会运行。如果我键入mvn failsafe:verify
它会失败并出现以下错误:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Simulation Experiment Server 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-failsafe-plugin:2.11:verify (default-cli) @ experiment-server ---
[INFO] Failsafe report directory: C:\IdeaProjects\experiment_server\target\failsafe-reports
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.551s
[INFO] Finished at: Fri Mar 30 11:24:58 GMT-06:00 2012
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.11:verify (default-cli) on project experiment-server: C:\IdeaProjects\experiment_server\target\failsafe-reports\failsafe-summary.xml (The system cannot find the path specified) -> [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/MojoExecutionException
它抱怨找不到failsafe-summary.xml
。但这应该由插件创建。该插件工作正常(failsafe-summary.xml
如果我运行 Antonio Goncalves 精彩的Arquillian 示例项目,则会创建文件。
所以我复制了 Antonio 使用的确切插件信息,但它仍然无法在我的项目上运行。我已经将我的 POM 建模为与他的完全一样(除了没有父 pom)——一定是出了问题,我只是不知道是什么。为什么故障保护会在他的项目上运行而不是我的?
这是我的故障安全 pom.xml 条目,它取自他的,与故障安全 usaages 站点上的条目相同):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${version.maven.failsafe.plugin}</version>
<configuration>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
感谢您的帮助,这让我发疯了。
更新好的,我似乎已经解决了cannot find failsafe-summary.xml
问题——我将目录从 更改experiment_server
为experiment-server
. 我想这会破坏故障安全。
但是,我仍然无法从命令mvn verify
或mvn integration-test
. 这两个命令都调用surefire而不是failsafe。我现在可以使用命令直接运行故障安全:mvn failsafe:integration-test
,但不应该自动运行故障安全mvn verify
吗?我的mvn help:effective-pom
节目表明故障安全存在,所以这不是问题......有什么想法吗?