If you want to use the CLI to exclude one test, you must use the -Dtest and -Dit.test .
Be careful to reset defaults. When you use notation ! , all default values ββare erased and you must return them back. For regular tests performed by surefire , you must add *Test, Test*, *Tests, *TestCase , while for integration tests performed by failsafe , you must add IT*, *IT, *ITCase .
You can find more information here https://maven.apache.org/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html (regular tests)
and here https://maven.apache.org/surefire/maven-failsafe-plugin/examples/inclusion-exclusion.html (integration tests)
-Dit.test='!ITsometestIT, IT*, *IT, *ITCase'
The full mvn could be:
mvn -e -B -Dtest='!unitTestABC, *Test, Test*, *Tests, *TestCase' -Dit.test='!ITintegrationTestABCIT, IT*, *IT, *ITCase' -DfailIfNoTests=false clean install
Remember to use ' , NOT. " When using double quotes, any ! Within them, bash will be evaluated.
Remember also that integration tests do not run with mvn test . With mvn verify only integration tests will be performed, not unit tests
Naramsim Oct 26 '18 at 12:18 2018-10-26 12:18
source share