How to run Scala Unit and Integration tests from Maven

57 Views Asked by At

I'm trying to set up Maven so that it can run both Unit and Integration tests using scalatest-maven-plugin, but I can't quite work out how to configure the plugin.

In source code terms my Unit tests are in files called _____Test.scala and the Integration tests will be in files called _____IntegrationTest.scala

If this were Java I would configure the maven-surefire-plugin as:

<execution>
    <goals>
        <goal>test</goal>
    </goals>
    <configuration>
        <excludes>
            <exclude>**/*IntegrationTest.java</exclude>
        </excludes>
    </configuration>
</execution>

and the maven-failsafe-plugin as

<execution>
    <goals>
        <goal>integration-test</goal>
    </goals>
    <configuration>
        <includes>
            <include>**/*IntegrationTest.java</include>
        </includes>
    </configuration>
</execution>

I want to do the same for the scalatest-maven-plugin, but with a different execution for for the Unit and Integration phases. My problem is that the includes and excludes configuration elements are not recognised by the plug-in. With out them I'm going to end up with all tests being run in all maven phases.

The author of this question appears to have had a similar problem, but there isn't an answer.

0

There are 0 best solutions below