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

    Copyright 2014-2017 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.metrics</groupId>
    <artifactId>hawkular-metrics-dist</artifactId>
    <version>0.27.0.Final</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>

  <artifactId>hawkular-metrics-standalone-dist</artifactId>
  <packaging>ear</packaging>

  <name>Hawkular Metrics Distribution for Standalone</name>
  <description>Hawkular Metrics Distribution (EAR) for Standalone</description>

  <dependencies>
    <dependency>
      <groupId>org.hawkular.metrics</groupId>
      <artifactId>hawkular-metrics-standalone</artifactId>
      <version>${project.version}</version>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.hawkular.alerts</groupId>
      <artifactId>hawkular-alerts-rest-metrics</artifactId>
      <version>${version.org.hawkular.alerts}</version>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.hawkular.metrics</groupId>
      <artifactId>hawkular-metrics-alerter</artifactId>
      <version>${project.version}</version>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.hawkular.alerts</groupId>
      <artifactId>hawkular-alerts-actions-elasticsearch-metrics</artifactId>
      <version>${version.org.hawkular.alerts}</version>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.hawkular.alerts</groupId>
      <artifactId>hawkular-alerts-actions-email-metrics</artifactId>
      <version>${version.org.hawkular.alerts}</version>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.hawkular.alerts</groupId>
      <artifactId>hawkular-alerts-actions-webhook-metrics</artifactId>
      <version>${version.org.hawkular.alerts}</version>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.hawkular.alerts</groupId>
      <artifactId>hawkular-elasticsearch-alerter-metrics</artifactId>
      <version>${version.org.hawkular.alerts}</version>
      <type>war</type>
    </dependency>
    <!-- Because metrics war has a dependency on alerting war (to inject AlertsService) and both components
         use cassalog, we hit an issue such that the metrics schema file resources could not be located, the CL
         was tied to the alerting war. To make them available we are placing the schema jar in the ear's lib,
         which is available to every deployment's CL. We may not need this if we have a better solution resulting
         from: https://github.com/hawkular/cassalog/issues/4   -->
    <dependency>
      <groupId>org.hawkular.metrics</groupId>
      <artifactId>hawkular-metrics-schema</artifactId>
      <version>${project.version}</version>
      <exclusions>
        <exclusion>
          <groupId>*</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- It seems like we should be able to pull cassalog up to ear/lib level.  But, for some reason the
         groovy-cassalog link can't deal with it. This is unlikely to change due to the groovy impl of
         cassalog, I'll leave this here just as a reminder not to try.
    <dependency>
      <groupId>org.cassalog</groupId>
      <artifactId>cassalog</artifactId>
      <version>${version.org.cassalog}</version>
      <exclusions>
        <exclusion>
          <groupId>*</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <version>${version.org.codehaus.groovy}</version>
    </dependency>
    -->
    <!-- Even more than cassalog it seems like the cassandra driver should be shareable at the ear level.
         But, when doing this bad things happen in metrics startup lifecycle, I'm not sure why.  I'll leave this
         here as a note. perhaps we can try again in the future.
    <dependency>
      <groupId>com.datastax.cassandra</groupId>
      <artifactId>cassandra-driver-core</artifactId>
    </dependency>
    -->
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-ear-plugin</artifactId>
        <configuration>
          <version>7</version>
          <initializeInOrder>true</initializeInOrder>
          <fileNameMapping>no-version</fileNameMapping>
          <defaultLibBundleDir>lib/</defaultLibBundleDir>
          <!--  <skinnyWars>true</skinnyWars> -->
          <modules>
            <webModule>
              <groupId>org.hawkular.alerts</groupId>
              <artifactId>hawkular-alerts-rest-metrics</artifactId>
              <bundleFileName>hawkular-alerts.war</bundleFileName>
              <contextRoot>/hawkular/alerts</contextRoot>
            </webModule>
            <webModule>
              <groupId>org.hawkular.alerts</groupId>
              <artifactId>hawkular-alerts-actions-elasticsearch-metrics</artifactId>
              <bundleFileName>hawkular-alerts-action-elasticsearch.war</bundleFileName>
              <contextRoot>/hawkular/actions/elasticsearch</contextRoot>
            </webModule>
            <webModule>
              <groupId>org.hawkular.alerts</groupId>
              <artifactId>hawkular-alerts-actions-email-metrics</artifactId>
              <bundleFileName>hawkular-alerts-action-email.war</bundleFileName>
              <contextRoot>/hawkular/actions/email</contextRoot>
            </webModule>
            <webModule>
              <groupId>org.hawkular.alerts</groupId>
              <artifactId>hawkular-alerts-actions-webhook-metrics</artifactId>
              <bundleFileName>hawkular-alerts-action-webhook.war</bundleFileName>
              <contextRoot>/hawkular/actions/webhook</contextRoot>
            </webModule>
            <webModule>
              <groupId>org.hawkular.alerts</groupId>
              <artifactId>hawkular-elasticsearch-alerter-metrics</artifactId>
              <bundleFileName>hawkular-elasticsearch-alerter.war</bundleFileName>
              <contextRoot>/hawkular/__alerter-elasticsearch</contextRoot>
            </webModule>
            <webModule>
              <groupId>org.hawkular.metrics</groupId>
              <artifactId>hawkular-metrics-standalone</artifactId>
              <bundleFileName>hawkular-metrics.war</bundleFileName>
              <contextRoot>/hawkular/metrics</contextRoot>
            </webModule>
            <webModule>
              <groupId>org.hawkular.metrics</groupId>
              <artifactId>hawkular-metrics-alerter</artifactId>
              <contextRoot>/hawkular/__alerter-metrics</contextRoot>
            </webModule>
          </modules>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>

