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

Suj*_*jen 5 integration-testing maven maven-failsafe-plugin

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

但是,如果我明确地调用插件来运行集成测试,它就可以工作(mvn failsafe:integration-test).

如何mvn clean installintegration-test阶段运行时让maven使用故障安全插件?

Sla*_*hin 11

官方文档引用:

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>
Run Code Online (Sandbox Code Playgroud)

这是你要找的?