Run a specific test with Apache Maven
Problem 1
How can I execute a specific test class using Maven ?
Solution
Using the option -Dtest=
followed by the simple test class name.
mvn test -Dtest=MyTestClass
Problem 2
And if I want to run only a specific test case of the class ?
Solution
Follow the test class name with a #
and the method name
mvn test -Dtest=MyTestClass#myMethodName