Maven没有使用故障安全插件进行集成测试

时间:2011-06-16 19:08:32

标签: maven integration-testing maven-failsafe-plugin

当我运行mvn clean install时,对于integration-test阶段,它不使用故障安全插件。

但是如果我明确地说要调用插件来运行集成测试,那么它可以正常工作(mvn failsafe:integration-test)。

mvn clean install阶段运行integration-test时,如何让maven使用failsafe插件?

1 个答案:

答案 0 :(得分:11)

引自official documentation

To use the Failsafe Plugin, you need to add the following configuration
to your pom.xml

<project>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.11</version>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  [...]
</project>

这是你要找的吗?