Running JUnit test suite using Maven

You can run test suite using following maven command:

 mvn test -Dtest=x.y.z.MyTestSuite

Note : x.y.z is the package name.


You can run it with -Dit.test=[package].AllTest (-Dtest with surefire), or configure the included tests in the pom:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.22.1</version>
    <configuration>
      <includes>
        <include>AllTest.java</include>
      </includes>
    </configuration>
  </plugin>

Tags:

Junit

Maven