I achieved this by adding a property to pom like:
<properties> <runSuite>**/FastTestSuite.class</runSuite> </properties>
and maven-surefire-plugin should be:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <includes> <include>${runSuite}</include> </includes> </configuration> </plugin>
therefore it by default runs FastTestSuite, but you can run another test, for example. SlowTestSuite using the maven command as:
mvn install -DrunSuite=**/SlowTestSuite.class -DfailIfNoTests=false
source share