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
It turns out that (at least in Surefire 2.19), the test pattern doesn't work with fully qualified class names. So the right solution is
mvn clean install -Dtest="*,!MyTest"
i.e. without the package path.
In Surefire 2.19.1, it should be possible to use fully qualified names. In versions older than 2.19, neither seems to work.