Friday, September 13, 2013

mvn test

maven test
The test scope is different with JUnit (in Eclipse)
The default includes for maven test will be (from http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html)
<includes>
 <include>**/Test*.java</include>
 <include>**/*Test.java</include>
 <include>**/*TestCase.java</include>
</includes>

Another option is to add the configuration in build plugins like:
            <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.16</version>
        <configuration>
          <excludes>
            <exclude>**/Test*.java</exclude>          
          </excludes>
        </configuration>
      </plugin>

No comments:

Post a Comment