Understand that it is quite a stupid question, but i am new to Maven. I use JUnit+Maven, how can I configure Maven to run not all tests with @Test annotation, but only specific test classes?
Asked
Active
Viewed 91 times
0
-
1Maybe [this](http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html) helps. – Jens Dec 19 '14 at 12:20
-
1possible duplicate of [Using Maven, how do I run specific tests?](http://stackoverflow.com/questions/7568632/using-maven-how-do-i-run-specific-tests) – Joe Dec 19 '14 at 12:40
-
The link from Jens is exactly what I need - thank you! – bvv Dec 19 '14 at 12:50
2 Answers
1
You can run tests from single class by running
mvn clean test -Dtest=MyTestClass
Or you can even use simple regex such as
mvn -Dtest=*UserTest clean test

Marcin Szymczak
- 11,199
- 5
- 55
- 63