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

南笙酒味 提交于 2019-12-13 13:12:24

问题


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:


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.



来源:https://stackoverflow.com/questions/26304362/why-failsafe-plugin-requires-both-integration-test-and-verify-goals

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!