Why failsafe plugin requires both integration-test

2019-06-23 16:23发布

I have the next pom.xml

<project>
   ...
     <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>2.6</version>
            <executions>
                <execution>
                    <id>integration-test</id>
                    <goals>
                        <goal>integration-test</goal>
                        <goal>verify</goal>
                    </goals>
                    <configuration>
                        <argLine>${failsafeArgLine}</argLine>
                        <includes>
                            <include>**/dmg/*IT.java</include>
                        </includes>
                        <skipTests>${skipTests}</skipTests>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    ...
</project>

The problem is that when I'm taking off verify goal then the build is every time successful even if there was test failures.

And when I'm Taking off integration-test goal the integration tests simply do not run

Why failsafe plugin requires both integration-test and verify goals?

1条回答
ら.Afraid
2楼-- · 2019-06-23 17:00

In Maven Failsafe plugin reference you can find simple answer why build is always successful

failsafe:integration-test runs the integration tests of an application.
  failsafe:verify verifies that the integration tests of an application passed.

Without verify goal test results are not checked at all(but they are executed), so failsafe plugin requires integration-test goal to run tests, and verify to "verify" their results.

查看更多
登录 后发表回答