The vmlens maven plugin uses the maven surefire plugin to run the unit tests. So most configuration which apply to the maven surefire plugin also apply to the vmlens plugin. To attach the java agent to the tests, the vmlens plugin runs the tests in a forked jvm.
vmlens uses the same syntax to include and exclude tests as the maven surefire plugin. The following shows an example for excluding tests
<project> ... <build> <plugins> <plugin> <groupId>com.vmlens</groupId> <artifactId>vmlens-maven-plugin</artifactId> <version>1.0.0</version> <configuration> <excludes> <exclude>com.vmlens.test.regression.TestVolatileCounter</exclude> </excludes> </configuration> </plugin> </plugins> </build> </project>
and for including tests.
<project> ... <build> <plugins> <plugin> <groupId>com.vmlens</groupId> <artifactId>vmlens-maven-plugin</artifactId> <version>1.0.0</version> <configuration> <includes> <include>com.vmlens.test.regression.TestAllTypes</include> </includes> </configuration> </plugin> </plugins> </build> </project>
The complete syntax is described in the maven surefire plugin documentation.
To avoid that the build fails when a race or deadlock was found by vmlens set the tag testFailureIgnore to true as in the example below:
<project> ... <build> <plugins> <plugin> <groupId>com.vmlens</groupId> <artifactId>vmlens-maven-plugin</artifactId> <version>1.0.0</version> <configuration> <testFailureIgnore>true</testFailureIgnore> </configuration> </plugin> </plugins> </build> </project>