<?xml version="1.0" encoding="UTF-8"?>
<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">
  <parent>
    <artifactId>workitems</artifactId>
    <groupId>org.jbpm.contrib</groupId>
    <version>7.15.0.Final</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>karaf-itests</artifactId>

  <properties>
    <java.module.name>org.kie.karaf.itests.main</java.module.name>

    <!-- The OSGi modules depend on both non-osgi and osgi jars (with different GAs. It seems there is no easy way
         to fix this. -->
    <enforcer.failOnDuplicatedClasses>false</enforcer.failOnDuplicatedClasses>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.drools</groupId>
        <artifactId>drools-bom</artifactId>
        <version>${version.org.kie}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.jbpm</groupId>
        <artifactId>jbpm-bom</artifactId>
        <version>${version.org.kie}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.drools.testcoverage</groupId>
        <artifactId>drools-test-suite</artifactId>
        <version>${project.version}</version>
        <type>test-jar</type>
      </dependency>
      <dependency>
        <groupId>org.apache.karaf</groupId>
        <artifactId>apache-karaf</artifactId>
        <version>${version.org.apache.karaf}</version>
        <type>tar.gz</type>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <groupId>*</groupId>
            <artifactId>*</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.karaf.features</groupId>
        <artifactId>org.apache.karaf.features.core</artifactId>
        <version>${version.org.apache.karaf}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.karaf.jndi</groupId>
        <artifactId>org.apache.karaf.jndi.core</artifactId>
        <version>${version.org.apache.karaf}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.karaf.jndi</groupId>
        <artifactId>org.apache.karaf.jndi.command</artifactId>
        <version>${version.org.apache.karaf}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.karaf.features</groupId>
        <artifactId>standard</artifactId>
        <version>${version.org.apache.karaf}</version>
        <type>xml</type>
        <classifier>features</classifier>
      </dependency>
      <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-container-karaf</artifactId>
        <version>${version.org.ops4j.pax.exam}</version>
      </dependency>
      <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-junit4</artifactId>
        <version>${version.org.ops4j.pax.exam}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.servicemix.bundles</groupId>
        <artifactId>org.apache.servicemix.bundles.javax-inject</artifactId>
        <version>${version.org.apache.servicemix.bundles.javax-inject}</version>
      </dependency>
      <dependency>
        <groupId>org.jbpm.contrib</groupId>
        <artifactId>camel-workitem</artifactId>
        <version>${project.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-osgi-integration</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-spring</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-aries-blueprint</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-ci</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-client</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-dmn-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-camel</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jbpm.contrib</groupId>
      <artifactId>camel-workitem</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Features XML Dependencies used by pax-exam to resolve features to be deployed during test -->
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-karaf-features</artifactId>
      <type>xml</type>
      <classifier>features</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.karaf.features</groupId>
      <artifactId>standard</artifactId>
      <type>xml</type>
      <classifier>features</classifier>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.github.tomakehurst</groupId>
      <artifactId>wiremock</artifactId>
      <classifier>standalone</classifier>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- Karaf distribution-->
    <dependency>
      <groupId>org.apache.karaf</groupId>
      <artifactId>apache-karaf</artifactId>
      <type>tar.gz</type>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>*</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.apache.karaf.features</groupId>
      <artifactId>org.apache.karaf.features.core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.karaf.jndi</groupId>
      <artifactId>org.apache.karaf.jndi.core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.ops4j.pax.exam</groupId>
      <artifactId>pax-exam-container-karaf</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.ops4j.pax.exam</groupId>
      <artifactId>pax-exam-junit4</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.servicemix.bundles</groupId>
      <artifactId>org.apache.servicemix.bundles.javax-inject</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.ops4j.pax.url</groupId>
      <artifactId>pax-url-aether</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-core</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.drools.testcoverage</groupId>
      <artifactId>drools-test-suite</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

    <!-- Unit Test -->
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>
    <!-- Replacement for the above excluded 'commons-logging:commons-logging' -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

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

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack-jbpm-jpa-orm-files</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.jbpm</groupId>
                  <artifactId>jbpm-persistence-jpa</artifactId>
                  <includes>META-INF/JBPMorm.xml</includes>
                </artifactItem>
                <artifactItem>
                  <groupId>org.jbpm</groupId>
                  <artifactId>jbpm-human-task-jpa</artifactId>
                  <includes>META-INF/Taskorm.xml</includes>
                </artifactItem>
                <artifactItem>
                  <groupId>org.jbpm</groupId>
                  <artifactId>jbpm-human-task-audit</artifactId>
                  <includes>META-INF/TaskAuditorm.xml</includes>
                </artifactItem>
              </artifactItems>
              <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!--TODO - Version number should be moved to BOM, ... -->
        <groupId>org.apache.servicemix.tooling</groupId>
        <artifactId>depends-maven-plugin</artifactId>
        <version>1.2</version>
        <executions>
          <execution>
            <id>generate-depends-file</id>
            <goals>
              <goal>generate-depends-file</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>fuse71</id>
      <properties>
        <version.org.ops4j.pax.exam>4.11.0</version.org.ops4j.pax.exam>
      </properties>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <kie.features.classifier>features-fuse</kie.features.classifier>
                <!--<additional.features.url>mvn:org.jboss.fuse.features/brms-features/VERSION/xml/features</additional.features.url>-->
                <!--<karaf.version>4.2.0.fuse-BUILDNUMBER</karaf.version>-->
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>