<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2015-2016 Red Hat, Inc. and/or its affiliates
    and other contributors as indicated by the @author tags.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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.hawkular.alerts</groupId>
    <artifactId>hawkular-alerts</artifactId>
    <version>0.8.2.Final</version>
  </parent>

  <artifactId>hawkular-alerts-engine</artifactId>
  <packaging>jar</packaging>

  <name>Hawkular Alerts Engine</name>

  <dependencies>

    <!-- Hawkular Alerts dependencies -->
    <dependency>
      <groupId>org.hawkular.alerts</groupId>
      <artifactId>hawkular-alerts-api</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-api</artifactId>
      <version>${version.org.drools}</version>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-core</artifactId>
      <version>${version.org.drools}</version>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-compiler</artifactId>
      <version>${version.org.drools}</version>
    </dependency>

    <dependency>
      <groupId>com.datastax.cassandra</groupId>
      <artifactId>cassandra-driver-core</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${version.com.google.guava}</version>
    </dependency>

    <!-- Wildfly dependencies -->
    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging-annotations</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging-processor</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>javax</groupId>
      <artifactId>javaee-api</artifactId>
      <version>${version.javaee.spec}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Tests -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>${version.org.slf4j}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.yaml</groupId>
      <artifactId>snakeyaml</artifactId>
      <version>${version.org.yaml}</version>
      <scope>test</scope>
    </dependency>

    <!-- A workaround for CASSANDRA-10071 -->
    <dependency>
      <groupId>com.thinkaurelius.thrift</groupId>
      <artifactId>thrift-server</artifactId>
      <version>0.3.7</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.cassandra</groupId>
      <artifactId>cassandra-all</artifactId>
      <scope>test</scope>
      <exclusions>
        <!-- A workaround for CASSANDRA-10071 -->
        <exclusion>
          <groupId>com.thinkaurelius.thrift</groupId>
          <artifactId>thrift-server</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <excludes>
          <exclude>hawkular-alerts/**</exclude>
        </excludes>
        <filtering>false</filtering>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration>
          <excludes combine.children="append">
            <exclude>**/*.data</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>

    <!-- Profiles to compile with specific clustering libraries -->
    <profile>
      <id>clustering-wildfly</id>
      <activation>
        <property>
          <name>!env</name>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.infinispan</groupId>
          <artifactId>infinispan-core</artifactId>
          <scope>provided</scope>
          <version>${version.org.infinispan.wildfly}</version>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>clustering-eap64</id>
      <activation>
        <property>
          <name>env</name>
          <value>eap64</value>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.infinispan</groupId>
          <artifactId>infinispan-core</artifactId>
          <scope>provided</scope>
          <version>${version.org.infinispan.eap64}</version>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <property>
                  <name>testOutput</name>
                  <value>${project.build.testOutputDirectory}</value>
                </property>
              </systemProperties>
              <excludes>
                <exclude>**/*/PerfRulesEngineTest.java</exclude>
                <exclude>**/*/CassPersistenceTest.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Profiles to control test scenarios -->
    <profile>
      <id>default-tests</id>
      <activation>
        <property>
          <name>!env</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <property>
                  <name>testOutput</name>
                  <value>${project.build.testOutputDirectory}</value>
                </property>
              </systemProperties>
              <excludes>
                <exclude>**/*/PerfRulesEngineTest.java</exclude>
                <exclude>**/*/CassPersistenceTest.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>perf-tests</id>
      <activation>
        <property>
          <name>env</name>
          <value>perf</value>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.infinispan</groupId>
          <artifactId>infinispan-core</artifactId>
          <scope>provided</scope>
          <version>${version.org.infinispan.wildfly}</version>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <property>
                  <name>testOutput</name>
                  <value>${project.build.testOutputDirectory}</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>
</project>
