Skip to content

Instantly share code, notes, and snippets.

@hascode
Last active January 2, 2016 19:18
Show Gist options
  • Save hascode/8349080 to your computer and use it in GitHub Desktop.
Save hascode/8349080 to your computer and use it in GitHub Desktop.
Maven Surefire/Failsave examples
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<excludes>
<exclude>it/**</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>skipSelenium</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.14</version>
<configuration>
<includes>
<include>it/**</include>
</includes>
<excludes>
<exclude>**/*SeleniumIntegrationTest.java</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
@lummerland
Copy link

Didn't work :(. I integrated this in my POM and atlas-integration-test starts all unit-tests and integration-tests and selenium-tests as well. The log says that the failsafe-config looks like this:

Failsafe integration-test configuration:
[INFO] <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <includes>
    <include>it/**</include>
  </includes>
  <excludes>
    <exclude>**/*$*</exclude>
    <exclude>**/Abstract*</exclude>
  </excludes>
  <systemPropertyVariables>
    <homedir.confluence>/home/anonymous/Projekte/repo/project/target/confluence/home</homedir.confluence>
    <baseurl.confluence>http://anonymous-ThinkPad-W530:1990/confluence</baseurl.confluence>
    <plugin.jar>/home/anonymous/Projekte/repo/project/target/bookmarks-plugin-1.1.4-SNAPSHOT.jar</plugin.jar>
    <reportsDirectory>/home/anonymous/Projekte/repo/project/target/group-__no_test_group__/tomcat6x/surefire-reports</reportsDirectory>
    <http.confluence.url>http://anonymous-ThinkPad-W530:1990/confluence</http.confluence.url>
    <http.confluence.port>1990</http.confluence.port>
    <context.path>/confluence</context.path>
    <context.confluence.path>/confluence</context.confluence.path>
    <baseurl>http://anonymous-ThinkPad-W530:1990/confluence</baseurl>
    <homedir>/home/anonymous/Projekte/repo/project/target/confluence/home</homedir>
    <testGroup>__no_test_group__</testGroup>
    <http.port>1990</http.port>
  </systemPropertyVariables>
  <reportsDirectory>/home/anonymous/Projekte/repo/project/target/group-__no_test_group__/tomcat6x/surefire-reports</reportsDirectory>
</configuration>

I don't get it :(

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