Question

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.

Était-ce utile?

La solution

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top