<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">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.kie.server</groupId>
    <artifactId>kie-server-tests</artifactId>
    <version>7.56.0.Final</version>
  </parent>

  <artifactId>kie-server-integ-tests-all</artifactId>

  <name>KIE :: Execution Server :: Tests :: Drools and jBPM Integration Tests</name>
  <description>KIE Execution Server Integration Tests (REST, JMS) with configuration to run on different supported containers.</description>

  <properties>
    <java.module.name>org.kie.server.itests.all</java.module.name>
    <org.drools.server.ext.disabled>false</org.drools.server.ext.disabled>
    <org.jbpm.server.ext.disabled>false</org.jbpm.server.ext.disabled>
    <org.kie.prometheus.server.ext.disabled>false</org.kie.prometheus.server.ext.disabled>
    <org.kie.scenariosimulation.server.ext.disabled>false</org.kie.scenariosimulation.server.ext.disabled>
  </properties>

  <dependencies>
    <!-- Common Kie server test classes -->
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-integ-tests-common</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- kie server deps -->
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-client</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Needed for DBExternalResource -->
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-test-util</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Used in Case tests -->
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-document</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-case-mgmt-api</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Deployments for application servers -->
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server</artifactId>
      <classifier>webc</classifier>
      <type>war</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server</artifactId>
      <classifier>ee7</classifier>
      <type>war</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server</artifactId>
      <classifier>ee8</classifier>
      <type>war</type>
      <scope>test</scope>
    </dependency>

    <!-- This is an artificial dependency to make sure the kie-server-tests modules are executed one at a time during
         parallel build (otherwise the tests fail because of conflicting port binding) -->
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-integ-tests-optaplanner</artifactId>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>*</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    
    <dependency>
      <groupId>io.swagger</groupId>
      <artifactId>swagger-parser</artifactId>
      <scope>test</scope>
    </dependency>
    
    
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <configuration>
            <systemPropertyVariables>
              <!-- Values are supplied by specific profiles -->
              <kie.server.remoting.url>${kie.server.remoting.url}</kie.server.remoting.url>
              <kie.server.base.http.url>${kie.server.base.http.url}</kie.server.base.http.url>
              <kie.server.context.factory>${kie.server.context.factory}</kie.server.context.factory>
              <kie.server.connection.factory>${kie.server.connection.factory}</kie.server.connection.factory>
              <kie.server.jndi.request.queue>${kie.server.jndi.request.queue}</kie.server.jndi.request.queue>
              <kie.server.jndi.response.queue>${kie.server.jndi.response.queue}</kie.server.jndi.response.queue>
              <org.jbpm.server.ext.disabled>${org.jbpm.server.ext.disabled}</org.jbpm.server.ext.disabled>
              <org.drools.server.ext.disabled>${org.drools.server.ext.disabled}</org.drools.server.ext.disabled>
              <org.optaplanner.server.ext.disabled>true</org.optaplanner.server.ext.disabled>
              <org.kie.prometheus.server.ext.disabled>${org.kie.prometheus.server.ext.disabled}</org.kie.prometheus.server.ext.disabled>
              <org.kie.scenariosimulation.server.ext.disabled>${org.kie.scenariosimulation.server.ext.disabled}</org.kie.scenariosimulation.server.ext.disabled>
              <kie.server.testing.kjars.build.settings.xml>${kie.server.testing.kjars.build.settings.xml}</kie.server.testing.kjars.build.settings.xml>
            </systemPropertyVariables>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>false</filtering>
      </testResource>
      <testResource>
        <directory>src/test/filtered-resources</directory>
        <filtering>true</filtering>
      </testResource>
      <testResource>
        <directory>../src/test/filtered-resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
        <configuration>
          <container>
            <systemProperties>
              <org.jbpm.server.ext.disabled>${org.jbpm.server.ext.disabled}</org.jbpm.server.ext.disabled>
              <org.drools.server.ext.disabled>${org.drools.server.ext.disabled}</org.drools.server.ext.disabled>
              <org.optaplanner.server.ext.disabled>true</org.optaplanner.server.ext.disabled>
              <org.kie.prometheus.server.ext.disabled>${org.kie.prometheus.server.ext.disabled}</org.kie.prometheus.server.ext.disabled>
              <org.kie.scenariosimulation.server.ext.disabled>${org.kie.scenariosimulation.server.ext.disabled}</org.kie.scenariosimulation.server.ext.disabled>
              <!-- For JMS executor tests. -->
              <org.kie.executor.jms>true</org.kie.executor.jms>
              <!-- For including complete stack trace in the response -->
              <org.kie.server.stacktrace.included>true</org.kie.server.stacktrace.included>
            </systemProperties>
          </container>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>local-test-run</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.kie.server</groupId>
          <artifactId>kie-server-services-common</artifactId>
          <scope>test</scope>
          <exclusions>
            <exclusion>
              <groupId>javax.xml.stream</groupId>
              <artifactId>stax-api</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>org.kie.server</groupId>
          <artifactId>kie-server-services-drools</artifactId>          
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.kie.server</groupId>
          <artifactId>kie-server-services-dmn</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.kie.server</groupId>
          <artifactId>kie-server-services-jbpm</artifactId>
          <scope>test</scope>
          <exclusions>
            <exclusion>
              <groupId>org.codehaus.woodstox</groupId>
              <artifactId>woodstox-core-asl</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>org.kie.server</groupId>
          <artifactId>kie-server-services-jbpm-ui</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.kie.server</groupId>
          <artifactId>kie-server-services-case-mgmt</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.kie.server</groupId>
          <artifactId>kie-server-services-prometheus</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.kie.server</groupId>
          <artifactId>kie-server-services-scenario-simulation</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.kie.server</groupId>
          <artifactId>kie-server-rest-common</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.kie.server</groupId>
          <artifactId>kie-server-rest-drools</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.kie.server</groupId>
          <artifactId>kie-server-rest-dmn</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.kie.server</groupId>
          <artifactId>kie-server-rest-prometheus</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.kie.server</groupId>
          <artifactId>kie-server-rest-scenario-simulation</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.kie.server</groupId>
          <artifactId>kie-server-rest-jbpm</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.kie.server</groupId>
          <artifactId>kie-server-rest-jbpm-ui</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.kie.server</groupId>
          <artifactId>kie-server-rest-case-mgmt</artifactId>
          <scope>test</scope>
        </dependency>

        <!-- Needed for jBPM persistence -->
        <dependency>
          <groupId>com.h2database</groupId>
          <artifactId>h2</artifactId>
          <scope>test</scope>
        </dependency>
        <!-- Contains org.jbpm.test.util.CloseSafeMemoryContextFactory used as a context factory for local tests -->
        <dependency>
          <groupId>org.jbpm</groupId>
          <artifactId>jbpm-test-util</artifactId>
          <scope>test</scope>
        </dependency>
        <!-- Excluding javax.activation-api as it collides with javax.activation:activation -->
        <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-core</artifactId>
          <scope>test</scope>
          <exclusions>
            <!-- collides with com.sun.xml.bind:jaxb-impl:jar:2.3.0 and com.sun.xml.bind:jaxb-impl:jar:2.3.0 -->
            <exclusion>
              <groupId>org.glassfish.jaxb</groupId>
              <artifactId>jaxb-runtime</artifactId>
            </exclusion>
            <exclusion>
              <groupId>javax.activation</groupId>
              <artifactId>javax.activation-api</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>tomcat9</id>
      <activation>
        <property>
          <name>container.profile</name>
          <value>tomcat9</value>
        </property>
      </activation>
    </profile>
    <profile>
      <id>wildfly</id>
      <activation>
        <property>
          <name>container.profile</name>
          <value>wildfly</value>
        </property>
      </activation>
    </profile>
    <profile>
      <id>eap7</id>
      <activation>
        <property>
          <name>container.profile</name>
          <value>eap7</value>
        </property>
      </activation>
    </profile>
    <profile>
      <id>oracle-wls-12</id>
      <activation>
        <property>
          <name>container.profile</name>
          <value>oracle-wls-12</value>
        </property>
      </activation>
    </profile>
    <profile>
      <id>websphere9</id>
      <activation>
        <property>
          <name>container.profile</name>
          <value>websphere9</value>
        </property>
      </activation>
    </profile>
    <profile>
      <id>springboot</id>
      <activation>
        <property>
          <name>container.profile</name>
          <value>springboot</value>
        </property>
      </activation>
      <properties>
        <kieserver.drools.enabled>true</kieserver.drools.enabled>
        <kieserver.dmn.enabled>true</kieserver.dmn.enabled>
        <kieserver.jbpm.enabled>true</kieserver.jbpm.enabled>
        <kieserver.jbpmui.enabled>true</kieserver.jbpmui.enabled>
        <kieserver.casemgmt.enabled>true</kieserver.casemgmt.enabled>
        <kieserver.prometheus.enabled>true</kieserver.prometheus.enabled>
        <kieserver.scenariosimulation.enabled>true</kieserver.scenariosimulation.enabled>
        <kieserver.swagger.enabled>true</kieserver.swagger.enabled>
        <jbpm.executor.disabled>true</jbpm.executor.disabled>
        <!-- For including complete stack trace in the response -->
        <org.kie.server.stacktrace.included>true</org.kie.server.stacktrace.included>
      </properties>
    </profile>
  </profiles>
</project>
