The syntax used above (qualified package name) requires Surefire version 2.19.1 or higher! Earlier versions require the use of path expressions, for example
mvn -Dtest="de/mypackage/*Test" test
I'm using quotes (` or ") to prevent the shell from performing pathname expansion, Maven doesn't require any quotes.
A single test method can be exuted using the following syntax
mvn -Dtest=MyUnitTest#testMethod test
All tests from subpackages may be includes as well, in order to execute all tests in or beneath package de.mypackage.sub execute:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<configuration>
<includes>
<!-- includes all tests, but not in subpackages -->
<include>**/package1/*</include>
<!-- includes all tests, AND in subpackages -->
<include>**/package2/**</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>