Skip to content

Instantly share code, notes, and snippets.

@rschumm
Last active August 29, 2015 13:56
Show Gist options
  • Save rschumm/8803701 to your computer and use it in GitHub Desktop.
Save rschumm/8803701 to your computer and use it in GitHub Desktop.
Integration-Test maven
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<executions>
<execution>
<id>default-test</id>
<configuration>
<excludes>
<exclude>**/*Rest*</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>integration-test</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<includes>
<include>**/*Rest*</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<profile>
<id>IntegrationTests</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/*Rest*</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
@rschumm
Copy link
Author

rschumm commented Feb 4, 2014

laufenlassen mit mvn test bzw. mvn integration-test

(so laufen aber bei einem mvn install die int-Tests mit - wenn man sie nicht will, muss man mvn test laufenlassen).

oder dann mit profil:
der Trick da ist das none, welches das vererbte exclude vom Haupt-Plugin-überschreibt.

oder direkt mit
mvn -Dtest=Rest test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment