I have the following configured in the parent pom of my multi module Maven project.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.7</version>
<configuration>
<skipTests>false</skipTests>
<useFile>false</useFile>
<disableXmlReport>true</disableXmlReport>
<!-- If you have classpath issue like NoDefClassError,...-->
<!-- useManifestOnlyJar>false</useManifestOnlyJar -->
<includes>
<include>**/*Test.*</include>
<include>**/*Suite.*</include>
<include>**/*Spec.*</include>
</includes>
</configuration>
</plugin>
<!-- enable scalatest -->
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<junitxml>.</junitxml>
<filereports>WDFTestSuite.txt</filereports>
</configuration>
<executions>
<execution>
<id>test</id>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
Nothing fancy here as it is just straight out the same configuration settings that could be found under the Scalatest documentation. But strangely, running the following does not detect any of my scala tests:
mvn clean install
[INFO]
[INFO] --- scalatest-maven-plugin:1.0:test (test) @ My-Project ---
Discovery starting.
Discovery completed in 103 milliseconds.
Run starting. Expected test count is: 0
DiscoverySuite:
Run completed in 160 milliseconds.
Total number of tests run: 0
Suites: completed 1, aborted 0
Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
No tests were executed.
Is there anything that I'm missing in the form of any configuration?
EDIT:
Here is how my project is structured:
parent-project
- pom.xml
- src
- main
- scala
- java
- main
- child-project
- pom.xml
- src
- main
- test
- scala
- java