Maven failsafe Plugin exclusion

Viewed 42

I have been trying to understand how maven works under the hood. I want to learn to switch off/on certain goals's during the execution. I have a question about the test plugin surefire and failsafe

I see that surefire plugin test goal is bound to the test phase in the /maven-core-/META-INF/plexus/default-bindings.xml

<test>
   org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
</test>

So running mvn test will execute this goal.

However failsafe does not have default binding and hence we specify the current project POM

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>2.19.1</version>
    <executions>
        <execution>
            <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <trimStackTrace>false</trimStackTrace>
    </configuration>
</plugin>

But even if I comment the integration-test

<!--<goal>integration-test</goal>-->

and run the mvn integration-test I see the tests run that are intended for integration test. Is the understanding for disabling correct ? Am i missing some other configuration.

0 Answers
Related