You can do this as follows:
Your pom.xml should contain the following setup.
<configuration>
<excludes>
<exclude>**/TestCircle.java</exclude>
<exclude>**/TestSquare.java</exclude>
</excludes>
</configuration>
If you want regex support just use
<excludes>
<exclude>%regex[.*[Cat|Dog].*Test.*]</exclude>
</excludes>
http://maven.apache.org/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html
If you want to use Category annotation, you need to do the following:
@Category(com.myproject.annotations.Exclude)
@Test
public testFoo() {
....
}
In your maven configuration, you can have something like this
<configuration>
<excludedGroups>com.myproject.annotations.Exclude</excludedGroups>
</configuration>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…