<!--

    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</groupId>
    <artifactId>hawkular</artifactId>
    <version>1.0.0.Alpha11</version>
  </parent>
  <artifactId>hawkular-feature-pack</artifactId>
  <packaging>pom</packaging>

  <name>Hawkular Feature Pack</name>
  <description>A feature pack that can be used to build a Hawkular distribution.</description>

  <dependencies>

    <dependency>
      <groupId>org.hawkular</groupId>
      <artifactId>hawkular-avail-creator</artifactId>
      <version>${project.version}</version>
      <type>war</type>
    </dependency>

    <dependency>
      <groupId>org.hawkular</groupId>
      <artifactId>hawkular-console</artifactId>
      <version>${project.version}</version>
      <type>war</type>
    </dependency>

    <dependency>
      <groupId>org.hawkular</groupId>
      <artifactId>hawkular-pinger</artifactId>
      <version>${project.version}</version>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.hawkular</groupId>
      <artifactId>hawkular-wildfly-agent-download</artifactId>
      <version>${project.version}</version>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.hawkular</groupId>
      <artifactId>hawkular-rest-api</artifactId>
      <version>${project.version}</version>
      <type>war</type>
    </dependency>

    <dependency>
      <groupId>org.hawkular.accounts</groupId>
      <artifactId>hawkular-accounts-feature-pack</artifactId>
      <version>${version.org.hawkular.accounts}</version>
      <type>zip</type>
    </dependency>

    <dependency>
      <groupId>org.hawkular.agent</groupId>
      <artifactId>hawkular-wildfly-agent-feature-pack</artifactId>
      <version>${version.org.hawkular.agent}</version>
      <type>zip</type>
    </dependency>

    <dependency>
      <groupId>org.hawkular.agent</groupId>
      <artifactId>hawkular-wildfly-agent-wf-extension</artifactId>
      <version>${version.org.hawkular.agent}</version>
      <type>zip</type>
    </dependency>

    <dependency>
      <groupId>org.hawkular.agent</groupId>
      <artifactId>hawkular-wildfly-agent-installer</artifactId>
      <version>${version.org.hawkular.agent}</version>
    </dependency>

    <dependency>
      <groupId>org.hawkular.alerts</groupId>
      <artifactId>hawkular-alerts-rest</artifactId>
      <version>${version.org.hawkular.alerts}</version>
      <type>war</type>
    </dependency>

    <dependency>
      <groupId>org.hawkular.alerts</groupId>
      <artifactId>hawkular-alerts-actions-email</artifactId>
      <version>${version.org.hawkular.alerts}</version>
      <type>war</type>
    </dependency>

    <dependency>
      <groupId>org.hawkular.btm</groupId>
      <artifactId>hawkular-btm-integrated-feature-pack</artifactId>
      <version>${version.org.hawkular.btm}</version>
      <type>zip</type>
    </dependency>

    <dependency>
      <groupId>org.hawkular.cmdgw</groupId>
      <artifactId>hawkular-command-gateway-war</artifactId>
      <version>${version.org.hawkular.cmdgw}</version>
      <type>war</type>
    </dependency>

    <dependency>
      <groupId>org.hawkular.inventory</groupId>
      <artifactId>hawkular-inventory-dist</artifactId>
      <version>${version.org.hawkular.inventory}</version>
      <type>war</type>
    </dependency>

    <dependency>
      <groupId>org.hawkular.metrics</groupId>
      <artifactId>hawkular-metrics-component</artifactId>
      <version>${version.org.hawkular.metrics}</version>
      <type>war</type>
    </dependency>

  </dependencies>

  <build>
    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack-deps</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.hawkular.agent</groupId>
                  <artifactId>hawkular-wildfly-agent-feature-pack</artifactId>
                  <version>${version.org.hawkular.agent}</version>
                  <type>zip</type>
                  <includes>subsystem-templates/*.xml</includes>
                  <outputDirectory>${project.build.directory}/feature-pack-resources</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>org.hawkular.accounts</groupId>
                  <artifactId>hawkular-accounts-feature-pack</artifactId>
                  <version>${version.org.hawkular.accounts}</version>
                  <type>zip</type>
                  <includes>subsystem-templates/*.xml</includes>
                  <outputDirectory>${project.build.directory}/feature-pack-resources</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/feature-pack-resources</outputDirectory>
              <resources>
                <resource>
                  <directory>${basedir}/src/main/resources</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.wildfly.build</groupId>
        <artifactId>wildfly-feature-pack-build-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>feature-pack-build</id>
            <phase>compile</phase>
            <goals>
              <goal>build</goal>
            </goals>
            <configuration>
              <resources-dir>target/feature-pack-resources</resources-dir>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>assemble</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>assembly.xml</descriptor>
              </descriptors>
              <appendAssemblyId>false</appendAssemblyId>
              <tarLongFileMode>gnu</tarLongFileMode>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
