I would like to skip a single test (e.g. com.example.MyTest
) when building a project with Maven from the command line.
I'm aware of similar questions like this one, but they all require either modification of source code or pom.xml
. I would like to do without modifications. How can I exclude a test using command line options only?
What I've tried so far after reading some documentation is
mvn clean install -Dtest="*,!com.example.MyTest"
but the test is still not skipped. I'm using surefire plugin version 2.19 and JUnit 4.11.