<?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>
    <groupId>org.kie</groupId>
    <artifactId>kie-wb-tests</artifactId>
    <version>7.2.0.Final</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>kie-wb-tests-rest</artifactId>

  <name>KIE (Drools) Workbench Tests :: REST API</name>
  <description>REST API tests for KIE Workbench and KIE Drools Workbench</description>

  <dependencies>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-net</groupId>
      <artifactId>commons-net</artifactId>
    </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>
    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-mapper-asl</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jgit</groupId>
      <artifactId>org.eclipse.jgit</artifactId>
    </dependency>
    <dependency>
      <groupId>org.guvnor</groupId>
      <artifactId>guvnor-rest-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-client</artifactId>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-jackson-provider</artifactId>
    </dependency>
    <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>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>wildfly-swarm</id>
      <activation>
        <property>
          <name>container</name>
          <value>wildfly-swarm</value>
        </property>
      </activation>
      <build>
        <testResources>
          <testResource>
            <directory>src/test/resources</directory>
          </testResource>
          <testResource>
            <!-- It's not ideal to go out of the module directory, but those resources are static (not generated by the
                 build itself) and also the only other alternative is to duplicate the resources in all the test modules
                 which use tem. -->
            <directory>../src/test/resources</directory>
            <filtering>true</filtering>
          </testResource>
        </testResources>
        <plugins>
          <plugin>
            <groupId>org.wildfly.swarm</groupId>
            <artifactId>wildfly-swarm-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
    <!-- Tests are disabled by default, but are automatically enabled when using specific profiles. So running
         "mvn clean install" will _not_ execute the tests, but "mvn clean install -Pwildfly10,kie-wb" will. -->
    <profile>
      <id>disable-cargo-and-itests</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <cargo.maven.skip>true</cargo.maven.skip>
        <skipITs>true</skipITs>
      </properties>
    </profile>
    <!-- 'kie-wb' and 'kie-drools-wb' are just dummy profiles ensuring there is a way to disable the profile
         'disable-cargo-and-itests' (so that the tests would actually be executed). -->
    <profile>
      <id>kie-wb</id>
    </profile>
    <profile>
      <id>kie-drools-wb</id>
    </profile>
  </profiles>

</project>