<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.18.0.Final</version>
  </parent>

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

  <name>KIE :: Execution Server :: Tests :: Controller Integration Tests</name>
  <description>KIE Execution Server Integration Tests (REST, JMS). Can be configured to run on different supported containers.</description>

  <properties>
    <java.module.name>org.kie.server.itests.controller</java.module.name>
    <version.org.glassfish.tyrus>1.11.1</version.org.glassfish.tyrus>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.kie.server</groupId>
        <artifactId>kie-server-controller-standalone</artifactId>
        <classifier>ee7</classifier>
        <type>war</type>
        <scope>test</scope>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.kie.server</groupId>
        <artifactId>kie-server-controller-standalone</artifactId>
        <classifier>webc</classifier>
        <type>war</type>
        <scope>test</scope>
        <version>${project.version}</version>
      </dependency>
     <dependency>
        <groupId>org.glassfish.tyrus</groupId>
        <artifactId>tyrus-container-jdk-client</artifactId>
        <version>${version.org.glassfish.tyrus}</version>
      </dependency>
      <dependency>
        <groupId>org.glassfish.tyrus</groupId>
        <artifactId>tyrus-spi</artifactId>
        <version>${version.org.glassfish.tyrus}</version>
      </dependency>
      <dependency>
        <groupId>org.glassfish.tyrus</groupId>
        <artifactId>tyrus-client</artifactId>
        <version>${version.org.glassfish.tyrus}</version>
      </dependency>
      <dependency>
        <groupId>org.glassfish.tyrus</groupId>
        <artifactId>tyrus-core</artifactId>
        <version>${version.org.glassfish.tyrus}</version>
      </dependency>
      <dependency>
        <groupId>org.jboss.spec.javax.websocket</groupId>
        <artifactId>jboss-websocket-api_1.1_spec</artifactId>
        <version>1.1.1.Final</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <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>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-controller-api</artifactId>
    </dependency>

    <!-- REST -->
    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-jaxrs</artifactId>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
        <exclusion>
          <groupId>net.jcip</groupId>
          <artifactId>jcip-annotations</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpcore</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    
    <!-- websocket -->
    <dependency>
      <groupId>io.undertow</groupId>
      <artifactId>undertow-servlet</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-controller-websocket-client</artifactId>
      <scope>test</scope>
    </dependency>    
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-controller-websocket-common</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <!-- Replacement for the above excluded 'commons-logging:commons-logging' -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
    </dependency>

    <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>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-controller-standalone</artifactId>
      <classifier>webc</classifier>
      <type>war</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-controller-standalone</artifactId>
      <classifier>ee7</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-all</artifactId>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>*</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </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.base.http.url>${kie.server.base.http.url}</kie.server.base.http.url>
              <kie.server.controller.base.http.url>${kie.server.controller.base.http.url}</kie.server.controller.base.http.url>
              <kie.server.controller.context>${kie.server.controller.context}</kie.server.controller.context>
              <kie.server.testing.kjars.build.settings.xml>${kie.server.testing.kjars.build.settings.xml}</kie.server.testing.kjars.build.settings.xml>
            </systemPropertyVariables>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.cargo</groupId>
          <artifactId>cargo-maven2-plugin</artifactId>
          <configuration>
            <container>
              <systemProperties>
                <org.jbpm.server.ext.disabled>true</org.jbpm.server.ext.disabled>
                <org.drools.server.ext.disabled>true</org.drools.server.ext.disabled>
                <org.kie.server.location>${kie.server.base.http.url}</org.kie.server.location>
                <org.kie.server.controller.user>yoda</org.kie.server.controller.user>
                <org.kie.server.controller.pwd>usetheforce123@</org.kie.server.controller.pwd>
                <org.kie.server.user>yoda</org.kie.server.user>
                <org.kie.server.pwd>usetheforce123@</org.kie.server.pwd>
              </systemProperties>
            </container>
            <deployables combine.children="append">
              <deployable>
                <groupId>${project.groupId}</groupId>
                <artifactId>kie-server-controller-standalone</artifactId>
                <!-- default, may be overriden in container specific profiles -->
                <classifier>${kie.server.controller.classifier}</classifier>
                <type>war</type>
                <properties>
                  <context>${kie.server.controller.context}</context>
                </properties>
                <pingURL>${kie.server.controller.base.http.url}/management/servers</pingURL>
                <pingTimeout>60000</pingTimeout>
              </deployable>
            </deployables>
          </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>
    </testResources>
    <plugins>
      <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>local-test-run</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.jboss.spec.javax.websocket</groupId>
          <artifactId>jboss-websocket-api_1.1_spec</artifactId>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>tomcat9</id>
      <properties>
        <kie.server.controller.classifier>webc</kie.server.controller.classifier>
      </properties>
      <dependencies>
        <dependency>
          <groupId>io.undertow</groupId>
          <artifactId>undertow-websockets-jsr</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>wildfly</id>
      <dependencies>
        <dependency>
          <groupId>io.undertow</groupId>
          <artifactId>undertow-websockets-jsr</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>eap7</id>
      <dependencies>
        <dependency>
          <groupId>io.undertow</groupId>
          <artifactId>undertow-websockets-jsr</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>oracle-wls-12</id>
      <dependencies>
        <dependency>
          <groupId>org.glassfish.tyrus</groupId>
          <artifactId>tyrus-container-jdk-client</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.glassfish.tyrus</groupId>
          <artifactId>tyrus-spi</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.glassfish.tyrus</groupId>
          <artifactId>tyrus-client</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.glassfish.tyrus</groupId>
          <artifactId>tyrus-core</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>websphere9</id>
      <dependencies>
        <dependency>
          <groupId>io.undertow</groupId>
          <artifactId>undertow-websockets-jsr</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
</project>
