Is there a way to skip only a single test in maven?

paulgreg picture paulgreg · May 7, 2009 · Viewed 47.3k times · Source

I would like to skip only a single test while launching mvn install.

Is there a way to do that ?

Answer

haridsv picture haridsv · Jun 13, 2016

You can specify an exclusion pattern to -Dtest option by prefixing it with an ! (exclamation mark). E.g.,

mvn -Dtest=\!FlakyTest* install

Found it in here and verified to be working. E.g., I was able to skip this flaky Jenkins test by using:

mvn -Dtest=\!CronTabTest* package