<?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.0.0.Alpha4</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>

   <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>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-client-hotrod</artifactId>
         <type>test-jar</type>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.karaf</groupId>
         <artifactId>apache-karaf</artifactId>
         <type>zip</type>
      </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>
      </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>
   </dependencies>

   <properties>
      <project.exports>
         !org.infinispan.commons.*,
         org.infinispan.marshall.core,
         org.infinispan.*;version=${project.version};-split-package:=error,
         stacks,
         configs,
         configs.xsite
      </project.exports>
   </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>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <executions>
               <execution>
                  <id>default-bundle</id>
                  <phase>process-classes</phase>
                  <goals>
                     <goal>bundle</goal>
                  </goals>
                  <configuration>
                     <instructions>
                        <Embed-Dependency>
                           infinispan-core;groupId=org.infinispan;type=jar;scope=compile;inline=true,
                           infinispan-core;groupId=org.infinispan;type=test-jar;scope=test;inline=true
                        </Embed-Dependency>
                        <Export-Package>${project.exports}</Export-Package>
                        <_exportcontents>${project.exports}</_exportcontents>
                        <Import-Package>
                           ${project.groupId}.commons;version=${project.version},
                           ${project.groupId}.commons.marshall;version=${project.version},
                           ${project.groupId}.commons.util.concurrent;version=${project.version},
                           ${project.groupId}.commons.util.concurrent.jdk8backported;version=${project.version},
                           ${project.groupId}.commons.*;version=${project.version},
                           javax.management,javax.naming,
                           javax.security.*,
                           javax.transaction;version="[1.1,2)",
                           javax.transaction.xa;version="[1.1,2)",
                           javax.xml.namespace,
                           javax.xml.parsers,
                           javax.xml.stream,
                           javax.xml.transform,
                           javax.xml.transform.dom,
                           javax.xml.transform.stream,
                           net.jcip.annotations;resolution:=optional,
                           org.jboss.logging;version="[3.1,4)",
                           org.jboss.marshalling;version="[1.3,3)",
                           org.jboss.marshalling.util;version="[1.3,3)",
                           org.jgroups;version="[3.4,4)",
                           org.jgroups.blocks;version="[3.4,4)",
                           org.jgroups.blocks.mux;version="[3.4,4)",
                           org.jgroups.conf;version="[3.4,4)",
                           org.jgroups.jmx;version="[3.4,4)",
                           org.jgroups.logging;version="[3.4,4)",
                           org.jgroups.protocols;version="[3.4,4)",
                           org.jgroups.protocols.relay;version="[3.4,4)",
                           org.jgroups.protocols.tom;version="[3.4,4)",
                           org.jgroups.stack;version="[3.4,4)",
                           org.jgroups.util;version="[3.4,4)",
                           org.junit,
                           org.w3c.dom,
                           org.xml.sax
                        </Import-Package>
                        
                        <Fragment-Host>org.jgroups;bundle-version=${version.jgroups}</Fragment-Host>
                     </instructions>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
               <execution>
                  <id>default-test</id>
                  <phase>none</phase>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>

   <profiles>
      <profile>
         <id>test-osgi</id>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-surefire-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>default-test</id>
                        <phase>test</phase>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
      </profile>
   </profiles>

</project>