<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <artifactId>session-replacement</artifactId>
  <parent>
    <groupId>com.amadeus</groupId>
    <artifactId>session</artifactId>
    <version>0.4.7</version>
  </parent>
  <name>session-replacement</name>
  <description>Implementation of session management for JEE HttpSessions and general use case. Includes implemenations of in-memory and redis session distribution.</description>
  <properties>
    <redis.version>3.2.8</redis.version>
    <redis.image>redis:${redis.version}-alpine</redis.image>
    <jedis.version>2.9.0</jedis.version>
    <slf4j.version>1.7.25</slf4j.version>
    <version.arquillian>1.1.13.Final</version.arquillian>
    <version.arquillian_jacoco>1.0.0.Alpha9</version.arquillian_jacoco>
    <version.jetty9>9.4.6.v20170531</version.jetty9>
    <version.tomcat7>7.0.77</version.tomcat7>
    <version.wildfly>10.0.0.Final</version.wildfly>
    <sonar.exclusions>**/org/slf4j/impl/*.java</sonar.exclusions>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.jboss.arquillian</groupId>
        <artifactId>arquillian-bom</artifactId>
        <version>${version.arquillian}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.jboss.shrinkwrap.resolver</groupId>
        <artifactId>shrinkwrap-resolver-bom</artifactId>
        <version>2.2.6</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.shrinkwrap.descriptors</groupId>
        <artifactId>shrinkwrap-descriptors-bom</artifactId>
        <version>2.0.0</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-core</artifactId>
        <version>3.2.4</version>
      </dependency>
      <dependency>
        <groupId>redis.clients</groupId>
        <artifactId>jedis</artifactId>
        <version>${jedis.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>javax.enterprise.concurrent</groupId>
        <artifactId>javax.enterprise.concurrent-api</artifactId>
        <version>1.0</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.2</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-jacoco</artifactId>
        <version>${version.arquillian_jacoco}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>com.amadeus</groupId>
      <artifactId>session-agent</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-core</artifactId>
    </dependency>
    <dependency>
      <groupId>redis.clients</groupId>
      <artifactId>jedis</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.enterprise.concurrent</groupId>
      <artifactId>javax.enterprise.concurrent-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jacoco</groupId>
      <artifactId>org.jacoco.core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jacoco</groupId>
      <artifactId>org.jacoco.agent</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.junit</groupId>
      <artifactId>arquillian-junit-container</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.extension</groupId>
      <artifactId>arquillian-jacoco</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.shrinkwrap.descriptors</groupId>
      <artifactId>shrinkwrap-descriptors-depchain</artifactId>
      <type>pom</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.shrinkwrap.resolver</groupId>
      <artifactId>shrinkwrap-resolver-depchain</artifactId>
      <type>pom</type>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <relocations>
                <relocation>
                  <pattern>redis.clients</pattern>
                  <shadedPattern>com.amadeus.session.shaded.redis.clients</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.slf4j</pattern>
                  <shadedPattern>com.amadeus.session.shaded.org.slf4j</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.commons.pool2</pattern>
                  <shadedPattern>com.amadeus.session.shaded.org.apache.commons.pool2</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.codahale.metrics</pattern>
                  <shadedPattern>com.amadeus.session.shaded.com.codahale.metrics</shadedPattern>
                </relocation>
              </relocations>
              <shadedArtifactAttached>true</shadedArtifactAttached>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- Create jboss module directory -->
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>jboss-module</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/assembly/jboss-module.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <forkCount>1</forkCount>
          <argLine>${jacoco.itArgLine}</argLine>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <argLine>${argLine}</argLine>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
              <excludePackageNames>org.slf4j.*</excludePackageNames>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>redis-single</id>
      <properties>
        <it.com.amadeus.session.redis.expiration>NOTIF</it.com.amadeus.session.redis.expiration>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
              <verbose>true</verbose>
              <useColor>true</useColor>
              <images>
                <image>
                  <name>${redis.image}</name>
                  <alias>redis</alias>
                  <run>
                    <cmd>redis-server --notify-keyspace-events Ex --bind 0.0.0.0</cmd>
                    <ports>
                      <!-- Port mappings: Redis internal port will be dynamically mapped 
                        and this (random) port will be assigned to the maven variable ${redis.port}. -->
                      <port>6379:6379</port>
                    </ports>
                    <wait>
                      <!-- Wait for this in logs -->
                      <log>The server is now ready</log>
                      <!-- ... but at max 10 seconds -->
                      <time>10000</time>
                    </wait>
                    <log>
                      <enabled>true</enabled>
                      <date>default</date>
                    </log>
                  </run>
                </image>
              </images>
              <verbose>true</verbose>
            </configuration>
            <executions>
              <execution>
                <id>start</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>start</goal>
                </goals>
              </execution>
              <execution>
                <id>stop</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>stop</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <!-- Pass redis conf to tests ... -->
                <com.amadeus.session.repository.conf>mode=SINGLE,port=6379,host=localhost</com.amadeus.session.repository.conf>
                <com.amadeus.session.redis.expiration>${it.com.amadeus.session.redis.expiration}</com.amadeus.session.redis.expiration>
                <redis.integration.tests>true</redis.integration.tests>
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>redis-sentinel</id>
      <properties>
        <it.com.amadeus.session.redis.expiration>NOTIF</it.com.amadeus.session.redis.expiration>
        <redis.sentinel.conf>--bind 0.0.0.0</redis.sentinel.conf>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
              <useColor>true</useColor>
              <logDate>default</logDate>
              <verbose>true</verbose>
              <images>
                <image>
                  <name>${redis.image}</name>
                  <alias>redis_master</alias>
                  <run>                  
                    <cmd>redis-server --notify-keyspace-events Ex --bind 0.0.0.0</cmd>
                    <ports>
                      <!-- Port mappings: Redis internal port will be dynamically mapped 
                        and this (random) port will be assigned to the maven variable ${redis.port}. -->
                      <port>6379:6379</port>
                      <port>6380:6380</port>
                      <port>26379:26379</port>
                      <port>26378:26378</port>
                      <port>26377:26377</port>
                    </ports>
                    <wait>
                      <!-- Wait for this in logs -->
                      <log>The server is now ready</log>
                      <!-- ... but at max 10 seconds -->
                      <time>10000</time>
                    </wait>
                    <log>
                      <enabled>true</enabled>
                      <date>default</date>
                    </log>
                  </run>                  
                </image>
                <image>
                  <name>redis_slave</name>
                  <alias>redis_slave</alias>
                  <run>
                    <cmd>redis-server --notify-keyspace-events Ex --port 6380 --slaveof 127.0.0.1 6379 --bind 0.0.0.0</cmd>
                    <ports>
                    </ports>
                    <wait>
                      <log>The server is now ready</log>
                      <time>10000</time>
                    </wait>
                    <network>
                      <mode>container</mode>
                      <name>redis_master</name>
                    </network>
                  </run>
                </image>
                <!-- Sentinel -->
                <image>
                  <name>redis_it_sentinel</name>
                  <alias>redis_it_sentinel_1</alias>
                  <build>
                    <from>${redis.image}</from>
                    <user>redis</user>
                    <ports>
                      <port>26379</port>
                      <port>26378</port>
                      <port>26377</port>
                    </ports>
                    <runCmds>
                      <runCmd>mkdir -p /maven</runCmd>
                      <runCmd>touch /maven/sentinel.conf</runCmd>
                      <runCmd>chown -R redis /maven</runCmd>
                    </runCmds>
                  </build>
                  <run>
                    <cmd>redis-server /maven/sentinel.conf --port 26379 --sentinel announce-port 26379 --bind 0.0.0.0 --sentinel monitor redis_master 127.0.0.1 6379 1 --sentinel down-after-milliseconds redis_master 5000 --sentinel failover-timeout redis_master 60000 --sentinel parallel-syncs redis_master 1 --sentinel announce-ip 127.0.0.1</cmd>
                    <wait>
                      <log>Sentinel ID</log>
                      <time>10000</time>
                    </wait>
                    <log>
                      <enabled>true</enabled>
                      <date>default</date>
                    </log>
                    <network>
                      <mode>container</mode>
                      <name>redis_master</name>
                    </network>
                  </run>
                </image>
                <image>
                  <name>redis_it_sentinel</name>
                  <alias>redis_it_sentinel_2</alias>
                  <run>
                    <cmd>redis-server /maven/sentinel.conf --port 26378 --sentinel announce-port 26378 --bind 0.0.0.0 --sentinel monitor redis_master 127.0.0.1 6379 1 --sentinel down-after-milliseconds redis_master 5000 --sentinel failover-timeout redis_master 60000 --sentinel parallel-syncs redis_master 1 --sentinel announce-ip 127.0.0.1</cmd>
                    <wait>
                      <log>Sentinel ID</log>
                      <time>10000</time>
                    </wait>
                    <network>
                      <mode>container</mode>
                      <name>redis_master</name>
                    </network>
                  </run>
                </image>
                <image>
                  <name>redis_it_sentinel</name>
                  <alias>redis_it_sentinel_3</alias>
                  <run>
                    <cmd>redis-server /maven/sentinel.conf --port 26377 --sentinel announce-port 26377 --bind 0.0.0.0 --sentinel monitor redis_master 127.0.0.1 6379 1 --sentinel down-after-milliseconds redis_master 5000 --sentinel failover-timeout redis_master 60000 --sentinel parallel-syncs redis_master 1 --sentinel announce-ip 127.0.0.1</cmd>
                    <wait>
                      <log>Sentinel ID</log>
                      <time>10000</time>
                    </wait>
                    <network>
                      <mode>container</mode>
                      <name>redis_master</name>
                    </network>
                  </run>
                </image>
              </images>
            </configuration>
            <executions>
              <execution>
                <id>start</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>build</goal>
                  <goal>start</goal>
                </goals>
              </execution>
              <execution>
                <id>stop</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>stop</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <com.amadeus.session.repository.conf>mode=SENTINEL,master=redis_master,host=127.0.0.1:26379/127.0.0.1:26378/127.0.0.1:26377</com.amadeus.session.repository.conf>
                <com.amadeus.session.redis.expiration>${it.com.amadeus.session.redis.expiration}</com.amadeus.session.redis.expiration>
                <redis.integration.tests>true</redis.integration.tests>
                <redis.integration.tests.use.docker.host>true</redis.integration.tests.use.docker.host>
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>arquillian-tests</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <!-- Pass artifact file to tests... -->
                <session-replacement.jar.file>${project.build.directory}/${project.build.finalName}-shaded.jar</session-replacement.jar.file>
                <arquillian.integration.tests>true</arquillian.integration.tests>
              </systemPropertyVariables>
              <includes>
                <include>**/ArqIT*.java</include>
              </includes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>wildfly-10-managed-arquillian</id>
      <properties>
        <serverRoot>${project.build.directory}/wildfly-${version.wildfly}</serverRoot>
      </properties>
      <dependencies>
        <dependency>
          <groupId>org.wildfly.arquillian</groupId>
          <artifactId>wildfly-arquillian-container-managed</artifactId>
          <version>2.1.0.Final</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <configuration>
              <skip>${maven.test.skip}</skip>
            </configuration>
            <executions>
              <execution>
                <id>unpack</id>
                <phase>process-test-classes</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.wildfly</groupId>
                      <artifactId>wildfly-dist</artifactId>
                      <version>${version.wildfly}</version>
                      <type>zip</type>
                      <overWrite>false</overWrite>
                      <outputDirectory>${project.build.directory}</outputDirectory>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <environmentVariables>
                <JBOSS_HOME>${project.build.directory}/wildfly-${version.wildfly}</JBOSS_HOME>
              </environmentVariables>
              <!--
              <systemPropertyVariables>
                <arquillian.launch>wildfly-10-managed-arquillian</arquillian.launch>
              </systemPropertyVariables>
              -->
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>jetty-9-embedded-arquillian</id>
      <dependencies>
        <dependency>
          <groupId>org.jboss.arquillian.container</groupId>
          <artifactId>arquillian-jetty-embedded-9</artifactId>
          <version>1.0.0.CR3</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>jetty-webapp</artifactId>
          <version>${version.jetty9}</version>
          <scope>provided</scope>
        </dependency>

        <dependency>
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>jetty-deploy</artifactId>
          <version>${version.jetty9}</version>
          <scope>provided</scope>
        </dependency>

        <dependency>
          <!-- Jetty annotations needed for Servlet 3.1 support -->
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>jetty-annotations</artifactId>
          <version>${version.jetty9}</version>
          <scope>provided</scope>
        </dependency>

        <dependency>
          <!-- Jetty plus and naming required for testing resource injections -->
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>jetty-plus</artifactId>
          <version>${version.jetty9}</version>
          <scope>provided</scope>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>tomcat-7-embedded-arquillian</id>
      <dependencies>
        <dependency>
          <groupId>org.jboss.arquillian.container</groupId>
          <artifactId>arquillian-tomcat-embedded-7</artifactId>
          <version>1.0.0</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.tomcat</groupId>
          <artifactId>tomcat-catalina</artifactId>
          <version>${version.tomcat7}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.tomcat</groupId>
          <artifactId>tomcat-coyote</artifactId>
          <version>${version.tomcat7}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.tomcat</groupId>
          <artifactId>tomcat-jasper</artifactId>
          <version>${version.tomcat7}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.tomcat</groupId>
          <artifactId>tomcat-jasper-el</artifactId>
          <version>${version.tomcat7}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>wildfly-10-managed-arquillian-redis</id>
      <properties>
        <serverRoot>${project.build.directory}/wildfly-${version.wildfly}</serverRoot>
      </properties>
      <dependencies>
        <dependency>
          <groupId>org.wildfly.arquillian</groupId>
          <artifactId>wildfly-arquillian-container-managed</artifactId>
          <version>2.1.0.Final</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
              <useColor>true</useColor>
              <images>
                <image>
                  <name>${redis.image}</name>
                  <alias>redis</alias>
                  <run>
                    <cmd>redis-server --notify-keyspace-events Ex --bind 0.0.0.0</cmd>
                    <ports>
                      <!-- Port mappings: Redis internal port will be dynamically mapped 
                        and this (random) port will be assigned to the maven variable ${redis.port}. -->
                      <port>6379:6379</port>
                    </ports>
                    <wait>
                      <!-- Wait for this in logs -->
                      <log>The server is now ready</log>
                      <!-- ... but at max 10 seconds -->
                      <time>10000</time>
                    </wait>
                    <log>
                      <enabled>true</enabled>
                      <date>default</date>
                    </log>
                  </run>
                </image>
              </images>
            </configuration>
            <executions>
              <execution>
                <id>start</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>start</goal>
                </goals>
              </execution>
              <execution>
                <id>stop</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>stop</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <configuration>
              <skip>${maven.test.skip}</skip>
            </configuration>
            <executions>
              <execution>
                <id>unpack</id>
                <phase>process-test-classes</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.wildfly</groupId>
                      <artifactId>wildfly-dist</artifactId>
                      <version>${version.wildfly}</version>
                      <type>zip</type>
                      <overWrite>false</overWrite>
                      <outputDirectory>${project.build.directory}</outputDirectory>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <environmentVariables>
                <JBOSS_HOME>${project.build.directory}/wildfly-${version.wildfly}</JBOSS_HOME>
              </environmentVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>wildfly-10-managed-arquillian-redislabs</id>
      <properties>
        <serverRoot>${project.build.directory}/wildfly-${version.wildfly}</serverRoot>
      </properties>
      <dependencies>
        <dependency>
          <groupId>org.wildfly.arquillian</groupId>
          <artifactId>wildfly-arquillian-container-managed</artifactId>
          <version>2.1.0.Final</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <configuration>
              <skip>${maven.test.skip}</skip>
            </configuration>
            <executions>
              <execution>
                <id>unpack</id>
                <phase>process-test-classes</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.wildfly</groupId>
                      <artifactId>wildfly-dist</artifactId>
                      <version>${version.wildfly}</version>
                      <type>zip</type>
                      <overWrite>false</overWrite>
                      <outputDirectory>${project.build.directory}</outputDirectory>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <environmentVariables>
                <JBOSS_HOME>${project.build.directory}/wildfly-${version.wildfly}</JBOSS_HOME>
              </environmentVariables>
              <systemPropertyVariables>
                <arquillian.launch>wildfly-10-managed-arquillian-redislabs</arquillian.launch>
                <com.amadeus.session.repository.factory>redis</com.amadeus.session.repository.factory>
                <com.amadeus.session.redis.port>12000</com.amadeus.session.redis.port>
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>