Search code examples
mavenmaven-pluginskipgatling

Skip gatling tests when building release


We have a module for gatling tests and want to build a release.

We use a gatling maven plugin so we can execute tests on the command line with "mvn gatling:execute":

<plugin>    
    <groupId>io.gatling</groupId>
    <artifactId>gatling-maven-plugin</artifactId>
    <version>${gatling-plugin.version}</version>
    <executions>
        <execution>
            <goals>
                <goal>execute</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Is there a way how to deactivate the plugin for building releases without deactivating the command line execution feature?

I first tried to change "testSourceDirectory" to "sourceDirectory" and "testResources" to "resources", but that didn't change the behaviour.

I found -Dgatling.skip to work for "mvn clean install" but not for building releases.


Solution

  • I just found that I can delete the part:

    <executions>
        <execution>
            <goals>
                <goal>execute</goal>
            </goals>
        </execution>
    </executions>
    

    Because this is the part that executes the gatling tests during the build.

    Without it, "mvn gatling:execute" will still work.