<?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-parent</artifactId>
      <version>9.4.0.CR3</version>
      <relativePath>../../pom.xml</relativePath>
   </parent>

   <artifactId>infinispan-as-lucene-integration</artifactId>
   <name>Integration tests - AS Lucene Directory</name>
   <description>Integration tests - Wildfly Lucene directory integration</description>

   <properties>
      <module.skipMavenRemoteResource>true</module.skipMavenRemoteResource>
   </properties>

   <dependencies>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-core</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-feature-pack-wf-modules</artifactId>
         <type>zip</type>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-search-backend-jms</artifactId>
         <version>${version.hibernate.search}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-search-orm</artifactId>
         <version>${version.hibernate.search}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.jboss.spec.javax.ejb</groupId>
         <artifactId>jboss-ejb-api_3.2_spec</artifactId>
         <version>1.0.0.Final</version>
         <scope>provided</scope>
      </dependency>
      <dependency>
         <groupId>org.jboss.spec.javax.jms</groupId>
         <artifactId>jboss-jms-api_2.0_spec</artifactId>
         <version>1.0.0.Final</version>
         <scope>provided</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.resolver</groupId>
         <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
         <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>org.apache.lucene</groupId>
         <artifactId>lucene-core</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.lucene</groupId>
         <artifactId>lucene-queryparser</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.lucene</groupId>
         <artifactId>lucene-facet</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.lucene</groupId>
         <artifactId>lucene-grouping</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-lucene-directory</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>com.h2database</groupId>
         <artifactId>h2</artifactId>
         <scope>test</scope>
         <!--
           This H2 version has to match the version bundled within WildFly
           as we start the server and then connect to it from within WildFly:
           it can not connect between different versions.
           -->
         <version>${version.h2.driver-within-wildfly}</version>
      </dependency>
      <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <scope>test</scope>
      </dependency>
   </dependencies>

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

      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <configuration>
               <skip>true</skip>
            </configuration>
         </plugin>

         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
               <testNGArtifactName>none:none</testNGArtifactName>
               <properties>
                  <listener>${junitListener}</listener>
               </properties>
            </configuration>
            <executions>
               <execution>
                  <goals>
                     <goal>integration-test</goal>
                     <goal>verify</goal>
                  </goals>
                  <configuration>
                     <redirectTestOutputToFile>true</redirectTestOutputToFile>
                      <systemPropertyVariables>
                          <version.hibernate.search>${version.hibernate.search}</version.hibernate.search>
                          <version.hibernate.core>${version.hibernate.core}</version.hibernate.core>
                      </systemPropertyVariables>
                     <argLine>${forkJvmArgs} ${testjvm.jigsawArgs}</argLine>
                  </configuration>
               </execution>
            </executions>
         </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>compile</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>compile</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-node-node1</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>${basedir}/src/wildflyConfig</directory>
                         </resource>
                        </resources>
                  </configuration>
               </execution>
               <execution>
                  <id>configure-as-node-node2</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>${basedir}/src/wildflyConfig</directory>
                              </resource>
                          </resources>
                      </configuration>
                  </execution>
            </executions>
          </plugin>
      </plugins>
   </build>

   <profiles>
      <profile>
         <id>smoke</id>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-failsafe-plugin</artifactId>
                  <executions>
                     <execution>
                        <phase>none</phase>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
      </profile>
   </profiles>

</project>
