<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2015 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>
    <artifactId>hawkular-inventory-parent</artifactId>
    <groupId>org.hawkular.inventory</groupId>
    <version>0.3.3.Final</version>
  </parent>

  <artifactId>hawkular-inventory-dist</artifactId>
  <packaging>war</packaging>

  <name>Hawkular Inventory REST War Distribution</name>
  <description>
    Overlays the rest servlet with bus and sets up the dependencies and default configuration to make it ready for
    inclusion in Hawkular.
  </description>

  <scm>
    <url>https://github.com/hawkular/hawkular-inventory</url>
    <connection>scm:git:https://github.com/hawkular/hawkular-inventory</connection>
    <developerConnection>scm:git:git@github.com:hawkular/hawkular-inventory.git</developerConnection>
    <tag>0.3.3.Final</tag>
  </scm>

  <dependencies>
    <dependency>
      <groupId>org.hawkular.inventory</groupId>
      <artifactId>hawkular-inventory-cdi</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.hawkular.inventory</groupId>
      <artifactId>hawkular-inventory-bus</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- these will be provided by our RA - the MDB itself will never need ActiveMQ specific classes -->
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-all</artifactId>
      <version>${version.org.apache.activemq}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-jaas</artifactId>
      <version>${version.org.apache.activemq}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.hawkular.inventory</groupId>
      <artifactId>hawkular-inventory-rest-api</artifactId>
      <version>${project.version}</version>
      <type>war</type>
      <scope>runtime</scope>
    </dependency>

    <!-- These 3 are to be included in Hawkular - We're using Titan on Cassandra there -->
    <dependency>
      <groupId>org.hawkular.inventory</groupId>
      <artifactId>hawkular-inventory-impl-tinkerpop-titan-provider</artifactId>
      <version>${project.version}</version>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>org.hawkular.inventory</groupId>
      <artifactId>hawkular-inventory-impl-tinkerpop</artifactId>
      <version>${project.version}</version>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>com.thinkaurelius.titan</groupId>
      <artifactId>titan-cassandra</artifactId>
      <version>0.5.4</version>
      <scope>runtime</scope>
      <exclusions>
        <exclusion>
          <!-- We get a newer version from Cassandra -->
          <groupId>org.jboss.netty</groupId>
          <artifactId>netty</artifactId>
        </exclusion>
        <exclusion>
          <!-- TODO HACK ALERT: We're coupling pinger here... -->
          <!-- We need to depend on another version that is also used in Pinger. This should disappear once pinger
          becomes a proper remote client of inventory. -->
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpclient</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- TODO HACK ALERT: We're coupling pinger here... -->
    <!-- This is being used by Pinger which also depends on us. Going forward should work shouldn't it? ;) -->
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.3.1</version>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging</artifactId>
    </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>org.jboss.spec.javax.ejb</groupId>
      <artifactId>jboss-ejb-api_3.2_spec</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <overlays>
            <overlay>
              <groupId>org.hawkular.inventory</groupId>
              <artifactId>hawkular-inventory-rest-api</artifactId>
            </overlay>
            <overlay>
              <!-- empty groupId/artifactId represents the current build -->
            </overlay>
          </overlays>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
