<?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>7.2.3.Final</version>
      <relativePath>../../parent/pom.xml</relativePath>
   </parent>

   <artifactId>integrationtests-osgi</artifactId>
   <name>Integration tests: Karaf</name>
   <packaging>bundle</packaging>
   <description>Integration tests for Infinispan running in OSGi/Karaf</description>

   <profiles>
      <profile>
         <id>disable-osgi-tests</id>
         <activation>
            <activeByDefault>false</activeByDefault>
            
            <jdk>[1.8,1.9]</jdk>
         </activation>
         <properties>
            <skipOSGiTests>true</skipOSGiTests>
         </properties>
      </profile>
      <profile>
         <id>smoke</id>
         <properties>
            <skipOSGiTests>true</skipOSGiTests>
         </properties>
      </profile>
   </profiles>

   <dependencies>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-commons</artifactId>
      </dependency>
      <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>infinispan-core</artifactId>
      </dependency>
      <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>infinispan-core</artifactId>
         <type>test-jar</type>
         <scope>test</scope>
         <exclusions>
            <exclusion>
               <groupId>org.jboss.logmanager</groupId>
               <artifactId>jboss-logmanager</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>infinispan-cachestore-jdbc</artifactId>
      </dependency>
      <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>infinispan-cachestore-jdbc</artifactId>
         <type>test-jar</type>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>infinispan-embedded</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-core</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-osgi</artifactId>
         <version>${version.hibernate.core}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.hibernate.javax.persistence</groupId>
         <artifactId>hibernate-jpa-2.1-api</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>infinispan-cachestore-jpa</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>infinispan-cachestore-jpa</artifactId>
         <type>test-jar</type>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
      </dependency>
      <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>infinispan-cachestore-leveldb</artifactId>
      </dependency>
      <dependency>
         <groupId>org.fusesource.leveldbjni</groupId>
         <artifactId>leveldbjni-all</artifactId>
      </dependency>
      <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>infinispan-server-hotrod</artifactId>
      </dependency>
      <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>infinispan-server-hotrod</artifactId>
         <type>test-jar</type>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>infinispan-cachestore-remote</artifactId>
      </dependency>
      <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>infinispan-osgi</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>com.mchange</groupId>
         <artifactId>c3p0</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>com.h2database</groupId>
         <artifactId>h2</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>infinispan-client-hotrod</artifactId>
         <type>test-jar</type>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.ops4j.pax.exam</groupId>
         <artifactId>pax-exam-container-karaf</artifactId>
      </dependency>
      <dependency>
         <groupId>org.ops4j.pax.exam</groupId>
         <artifactId>pax-exam-junit4</artifactId>
         <exclusions>
            <exclusion>
               <artifactId>bndlib</artifactId>
               <groupId>biz.aQute.bnd</groupId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>org.ops4j.pax.exam</groupId>
         <artifactId>pax-exam</artifactId>
      </dependency>
      <dependency>
         <groupId>org.ops4j.pax.exam</groupId>
         <artifactId>pax-exam-inject</artifactId>
      </dependency>
      <dependency>
         <groupId>org.ops4j.pax.url</groupId>
         <artifactId>pax-url-aether</artifactId>
      </dependency>
      <dependency>
         <groupId>org.ops4j.pax.url</groupId>
         <artifactId>pax-url-assembly</artifactId>
      </dependency>
      <dependency>
         <groupId>org.ops4j.pax.url</groupId>
         <artifactId>pax-url-wrap</artifactId>
      </dependency>
      <dependency>
         <groupId>org.apache.karaf.features</groupId>
         <artifactId>org.apache.karaf.features.core</artifactId>
         <scope>test</scope>
      </dependency>
   </dependencies>

   <properties>
      <defaultTestGroup />
      <defaultExcludedTestGroup />
      <infinispan.test.parallel.threads>1</infinispan.test.parallel.threads>
      <infinispan.test.jgroups.protocol>tcp</infinispan.test.jgroups.protocol>
      <target.tmp.dir>${project.build.directory}/tmp/</target.tmp.dir>
      <skipOSGiTests>${skipTests}</skipOSGiTests>
   </properties>

   <build>
      <testResources>
         <testResource>
            <directory>${project.basedir}/src/test/resources</directory>
            <filtering>true</filtering>
            <includes>
               <include>**/*</include>
            </includes>
         </testResource>
      </testResources>
      <plugins>
         
         <plugin>
            <groupId>org.apache.servicemix.tooling</groupId>
            <artifactId>depends-maven-plugin</artifactId>
            <executions>
               <execution>
                  <id>generate-depends-file</id>
                  <goals>
                     <goal>generate-depends-file</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
               <execution>
                  <phase>generate-sources</phase>
                  <configuration>
                     <target>
                        <mkdir dir="${target.tmp.dir}" />
                     </target>
                  </configuration>
                  <goals>
                     <goal>run</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
               <threadCount>1</threadCount>
               <parallel>classes</parallel>
               <systemPropertyVariables>
                  <java.io.tmpdir>${target.tmp.dir}</java.io.tmpdir>
               </systemPropertyVariables>
               <runOrder>alphabetical</runOrder>
               <skipTests>${skipOSGiTests}</skipTests>
               <testNGArtifactName>none:none</testNGArtifactName>
               <properties>
                  <property>
                     <name>listener</name>
                     <value>org.junit.runner.notification.RunListener</value>
                  </property>
               </properties>
            </configuration>
            <executions>
               <execution>
                  <id>default-test</id>
                  <phase>test</phase>
                  <goals>
                     <goal>test</goal>
                  </goals>
                  <configuration>
                     <groups>org.ops4j.pax.exam.spi.reactors.PerSuite</groups>
                  </configuration>
               </execution>
               <execution>
                  <id>new-container</id>
                  <phase>test</phase>
                  <goals>
                     <goal>test</goal>
                  </goals>
                  <configuration>
                     <excludedGroups>org.ops4j.pax.exam.spi.reactors.PerSuite</excludedGroups>
                  </configuration>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>
</project>