0

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?

bvv
  • 3
  • 3
  • 1
    Maybe [this](http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html) helps. – Jens Dec 19 '14 at 12:20
  • 1
    possible 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 Answers2

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
-1

Use @Ignore on the class.

@Ignore
public class TestClass {
fmcato
  • 172
  • 1
  • 12