-1

I'm wondering if there is a way to specify in Maven which collection of JUnit tests run based on package names. An 'exclude' would be ideal, since I have fewer that I need not run than I have those that need to run.

Tunaki
  • 132,869
  • 46
  • 340
  • 423
Gary Sharpe
  • 2,369
  • 8
  • 30
  • 51
  • possible duplicate of [Is there a way to tell surefire to skip tests in a certain package?](http://stackoverflow.com/questions/4389744/is-there-a-way-to-tell-surefire-to-skip-tests-in-a-certain-package) – Joe May 04 '14 at 09:46

1 Answers1

1

Yes you can configure surefire plugin to include certain tests only

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.17</version>
        <configuration>
          <includes>
            <include>com/abc/*Test.java</include>
          </includes>
        </configuration>
      </plugin>
    </plugins>
  </build>

http://maven.apache.org/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html

kryger
  • 12,906
  • 8
  • 44
  • 65
jmj
  • 237,923
  • 42
  • 401
  • 438