mercredi 14 novembre 2018

Maven Failsafe Plugin: how to execute code in post-integration-test phase

It's not clear to me how to use the Maven Failsafe plugin for integration tests.

I need to execute some code to clean up the environment after all tests. I read that I could use Maven Failsafe Plugin for that.

I use Spock framework and Geb for testing. I have Maven FailSafe Plugin in my pom already:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <executions>
        <execution>
            <id>integration-test</id>
            <phase>integration-test</phase>
            <goals>
                <goal>integration-test</goal>
            </goals>
        </execution>
        <execution>
            <id>verify</id>
            <phase>verify</phase>
            <goals>
                <goal>verify</goal>
            </goals>
        </execution>
    </executions>
</plugin>

How should I use or configure this plugin to execute the code I want to execute after all tests are completed?

Aucun commentaire:

Enregistrer un commentaire