Maven failsafe插件不会在我的项目上运行。如果我运行mvn,验证只运行surefire。如果我键入mvn failsafe:验证它是否失败,并显示以下错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.11:verify (default-cli) on project experiment-server: /home/user/workspace/MyProject-Main/MyProject-IntegrationTest/target/failsafe-summary.xml (The system cannot find the path specified) -> [Help 1]所以我基本上有相同的问题:failsafe plugin won't run on one project but will run on another -- why?,不同的是我的pom已经看起来像这样:
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.14.1</version>
<executions>
<execution>
<id>failsafe-integration-tests</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>failsafe-verify</id>
<phase>verify</phase>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>这就是解决这个问题的方法。除了这个网站上的解决方案对我不起作用。有人能指出我哪里搞砸了吗?
我还有一个问题,我想在预集成阶段用exec-maven-plugin启动一个服务器。但是当我尝试mvn时,验证它是最后执行的东西。
发布于 2013-10-27 03:54:08
刚刚发现了这个问题,解决方案在这里:http://maven.apache.org/surefire/maven-failsafe-plugin/plugin-info.html
例如,maven-failsafe-plugin不在默认的maven构建生命周期中,这与maven-编译器-plugin相反。
因此,必须遵守此标记层次结构:
<project>
<build>
<pluginManagement>
<plugins>
<!-- For understanding only, below is the 'maven-compiler-plugin':
its path is 'project -> build -> pluginManagement -> plugins
-> plugin', because it's defaulty part of the maven build
lifecycle: we just 'manage' it -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
..
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!-- HERE is the 'maven-failsafe-plugin':
its path is 'project -> build -> plugins ->
plugin', because it's NOT defaulty part of
the maven build lifecycle: we have to
'define' it, and not just manage it as
stated earlier -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
..
</plugin>
</plugins>
</build>
<project>引用官方文档链接:“在您的父POM中定义插件版本”和“在您的POM或父POM中使用插件目标”。人们必须注意其中的差异。
发布于 2013-05-18 16:58:41
我把我的故障保护pom片段移到了父母的pom上,这似乎起到了作用。我不知道为什么。
https://stackoverflow.com/questions/16615342
复制相似问题