<?xml version='1.0' encoding='UTF-8'?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <modelVersion>4.0.0</modelVersion>

   <parent>
      <groupId>org.infinispan</groupId>
      <artifactId>infinispan-server-integration</artifactId>
      <version>12.0.0.Dev3</version>
      <relativePath>../pom.xml</relativePath>
   </parent>

   <artifactId>infinispan-wildfly-module-integrationtests</artifactId>
   <name>Integration tests - WildFly Module Integration Tests</name>
   <description>Integration tests - WildFly Module Integration Tests</description>

   <properties>
      <ispnserver.project.dir>${basedir}/../../../server/runtime</ispnserver.project.dir>
      <ispn.config.file>${basedir}/../server-integration-commons/src/test/resources/infinispan-custom.xml</ispn.config.file>
      <resources.dir>${basedir}/src/test/resources</resources.dir>
      <serverMemoryJvmArgs>-Xmx300m</serverMemoryJvmArgs>
      <jvm.x64.args />
      <transport.stack>-Dinfinispan.cluster.stack=${infinispan.cluster.stack}</transport.stack>
      <jvm.ip.stack>-Djava.net.preferIPv4Stack=true</jvm.ip.stack>
      <mcast.ip>234.99.54.14</mcast.ip>
      <jvm.ip.stack>-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false -Djboss.default.multicast.address=${mcast.ip}</jvm.ip.stack>
      <server.jvm>${env.JAVA_HOME}</server.jvm>
      <server.jvm.args>${testjvm.commonArgs} ${testjvm.jdkSpecificArgs} ${testjvm.extraArgs} ${jvm.ip.stack} ${serverMemoryJvmArgs} ${transport.stack} ${jvm.x64.args}</server.jvm.args>
      <log4j.configurationFile>log4j2.xml</log4j.configurationFile>
   </properties>

   <dependencies>
      <dependency>
         <groupId>org.infinispan.protostream</groupId>
         <artifactId>protostream-processor</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-cdi-embedded</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-core</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-core</artifactId>
         <scope>test</scope>
         <type>test-jar</type>
      </dependency>
      <dependency>
         <groupId>org.eclipse.microprofile.config</groupId>
         <artifactId>microprofile-config-api</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-client-hotrod</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-remote-query-client</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-server-runtime</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.infinispan.protostream</groupId>
         <artifactId>protostream</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-commons-test</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-cachestore-jdbc</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-cachestore-rocksdb</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-cachestore-jpa</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-jcache</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-query</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-query-core</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.shrinkwrap.resolver</groupId>
         <artifactId>shrinkwrap-resolver-depchain</artifactId>
         <type>pom</type>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.jboss.shrinkwrap.descriptors</groupId>
         <artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.wildfly.arquillian</groupId>
         <artifactId>wildfly-arquillian-container-managed</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>javax.enterprise</groupId>
         <artifactId>cdi-api</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>javax.cache</groupId>
         <artifactId>cache-api</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>javax.persistence</groupId>
         <artifactId>javax.persistence-api</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <scope>test</scope>
      </dependency>

      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-feature-pack</artifactId>
         <version>${project.version}</version>
         <type>zip</type>
         <scope>test</scope>
      </dependency>

      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-server-integrationtests-commons</artifactId>
         <type>test-jar</type>
         <scope>test</scope>
      </dependency>

   </dependencies>

   <build>
      <testResources>
         <testResource>
            <filtering>true</filtering>
            <directory>src/test/resources</directory>
         </testResource>
      </testResources>

      <plugins>
         <plugin>
             <artifactId>maven-clean-plugin</artifactId>
             <configuration>
                 <filesets>
                     <fileset>
                         <directory>Infinispan-LevelDBStore</directory>
                     </fileset>
                 </filesets>
             </configuration>
         </plugin>

         <plugin>
            <groupId>org.wildfly.build</groupId>
            <artifactId>wildfly-server-provisioning-maven-plugin</artifactId>
            <executions>
               <execution>
                  <id>server-provisioning-node1</id>
                  <goals>
                     <goal>build</goal>
                  </goals>
                  <phase>pre-integration-test</phase>
                  <configuration>
                     <config-file>server-provisioning.xml</config-file>
                     <server-name>node1</server-name>
                  </configuration>
               </execution>
               <execution>
                  <id>server-provisioning-node2</id>
                  <goals>
                     <goal>build</goal>
                  </goals>
                  <phase>pre-integration-test</phase>
                  <configuration>
                     <config-file>server-provisioning.xml</config-file>
                     <server-name>node2</server-name>
                  </configuration>
               </execution>
            </executions>
         </plugin>

         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
               <!-- Copy the AS configuration files so we can use our custom configurations -->
               <execution>
                  <id>configure-as-node1</id>
                  <phase>pre-integration-test</phase>
                  <goals>
                     <goal>copy-resources</goal>
                  </goals>
                  <configuration>
                     <skip>${skipTests}</skip>
                     <outputDirectory>${project.build.directory}/node2</outputDirectory>
                     <overwrite>true</overwrite>
                     <resources>
                        <resource>
                           <directory>${project.build.testOutputDirectory}/as-config</directory>
                        </resource>
                     </resources>
                  </configuration>
               </execution>
               <execution>
                  <id>configure-as-node2</id>
                  <phase>pre-integration-test</phase>
                  <goals>
                     <goal>copy-resources</goal>
                  </goals>
                  <configuration>
                     <skip>${skipTests}</skip>
                     <outputDirectory>${project.build.directory}/node1</outputDirectory>
                     <overwrite>true</overwrite>
                     <resources>
                        <resource>
                           <directory>${project.build.testOutputDirectory}/as-config</directory>
                        </resource>
                     </resources>
                  </configuration>
               </execution>

            </executions>
         </plugin>
      </plugins>
   </build>

   <profiles>
      <profile>
         <id>nexus-staging</id>
         <activation>
            <property><name>!skipNexusStaging</name></property>
         </activation>
         <build>
            <plugins>
               <plugin>
                  <artifactId>maven-deploy-plugin</artifactId>
                  <configuration>
                     <skip>true</skip>
                  </configuration>
               </plugin>
            </plugins>
         </build>
      </profile>

      <profile>
         <id>smoke</id>
         <properties>
            <skipTests>true</skipTests>
         </properties>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-failsafe-plugin</artifactId>
                  <configuration>
                     <skipITs>${skipTests}</skipITs>
                  </configuration>
               </plugin>
            </plugins>
         </build>
      </profile>

      <profile>
         <id>java8-test</id>
         <activation>
            <activeByDefault>false</activeByDefault>
         </activation>
         <properties>
            <server.jvm>${env.JAVA8_HOME}</server.jvm>
            <server.jvm.args>${testjvm.commonArgs} ${testjvm.jdkSpecificArgs} ${testjvm.extraArgs} ${jvm.ip.stack} ${serverMemoryJvmArgs} ${transport.stack} ${jvm.x64.args}</server.jvm.args>
         </properties>
      </profile>
   </profiles>
</project>
