<?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</groupId>
    <artifactId>hawkular-api-parent</artifactId>
    <version>1.0.0.Alpha9</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>hawkular-rest-api</artifactId>
  <version>1.0.0.Alpha9</version>
  <packaging>war</packaging>

  <name>Hawkular: REST API Web Application</name>
  <description>Component that allows users to interface with Hawkular. One rest call to it's endpoint will probably end up with multiple requests to the individual components.</description>

  <properties>
  </properties>

  <dependencies>

    <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>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.1.0</version>
      <scope>provided</scope>
    </dependency>

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

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

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

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

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

    <dependency>
      <groupId>org.hawkular.inventory</groupId>
      <artifactId>hawkular-inventory-json-helper</artifactId>
      <version>${version.org.hawkular.inventory}</version>
    </dependency>

    <dependency>
      <groupId>com.datastax.cassandra</groupId>
      <artifactId>cassandra-driver-core</artifactId>
    </dependency>

    <!-- RX -->
    <dependency>
      <groupId>com.netflix.hystrix</groupId>
      <artifactId>hystrix-core</artifactId>
    </dependency>

    <dependency>
      <groupId>com.netflix.hystrix</groupId>
      <artifactId>hystrix-request-servlet</artifactId>
      <version>1.1.2</version>
    </dependency>
<!--
    <dependency>
      <groupId>io.reactivex</groupId>
      <artifactId>rxjava</artifactId>
    </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.accounts</groupId>
      <artifactId>hawkular-accounts-api</artifactId>
      <version>1.1.2.Final</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Wildfly provided -->
    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-jaxrs</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>javax.inject</groupId>
      <artifactId>javax.inject</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>javax.enterprise</groupId>
      <artifactId>cdi-api</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.transaction</groupId>
      <artifactId>jboss-transaction-api_1.2_spec</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- docs -->

    <dependency>
      <groupId>com.wordnik</groupId>
      <artifactId>swagger-annotations</artifactId>
      <version>1.5.3-M1</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.wordnik</groupId>
      <artifactId>swagger-core</artifactId>
      <version>1.5.3-M1</version>
    </dependency>

    <!-- javadoc requires all the annotations on the classpath -->
    <dependency>
      <groupId>org.hibernate.javax.persistence</groupId>
      <artifactId>hibernate-jpa-2.1-api</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>javax.interceptor</groupId>
      <artifactId>javax.interceptor-api</artifactId>
      <version>1.2</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <finalName>hawkular-${project.artifactId}-${project.version}</finalName>
    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>${version.maven-war-plugin}</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
            <!-- <manifestEntries> <Build-Number>${buildNumber}</Build-Number>
              </manifestEntries> -->
          </archive>
          <webResources>
            <resource>
              <filtering>false</filtering>
              <directory>${basedir}/src/main/webapp</directory>
            </resource>
          </webResources>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <profiles>
    <profile>
      <id>docgen</id>
      <build>
        <!-- Document generation from the Swagger annotations on the REST-API. -->
        <plugins>
          <plugin>
            <groupId>com.github.kongchen</groupId>
            <artifactId>swagger-maven-plugin</artifactId>
            <configuration>
              <apiSources>
                <apiSource>
                  <locations>org.hawkular.inventory.rest</locations>
                  <apiVersion>0.1</apiVersion>
                  <basePath>http://localhost:8080/hawkular/inventory</basePath>
                  <outputTemplate>https://raw.githubusercontent.com/hawkular/hawkular.github.io/swagger/asciidoc.mustache</outputTemplate>
                  <swaggerDirectory>${project.build.directory}/generated/swagger-ui</swaggerDirectory>
                  <swaggerApiReader>com.wordnik.swagger.jaxrs.reader.DefaultJaxrsApiReader</swaggerApiReader>
                  <outputPath>${project.build.directory}/generated/rest-inventory.adoc</outputPath>
                </apiSource>
              </apiSources>
            </configuration>
            <executions>
              <execution>
                <phase>compile</phase>
                <goals>
                  <goal>generate</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
<!--
    <profile>
      <id>dev</id>
      <properties>
        <wf.home>${project.build.directory}/wildfly-${version.org.wildfly}</wf.home>
      </properties>
      <dependencies>
        <dependency>
          <groupId>org.wildfly</groupId>
          <artifactId>wildfly-dist</artifactId>
          <version>${version.org.wildfly}</version>
          <type>zip</type>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>unpack-wildfly</id>
                <phase>package</phase>
                <goals>
                  <goal>unpack-dependencies</goal>
                </goals>
                <configuration>
                  <includeGroupIds>org.wildfly</includeGroupIds>
                  <includeArtifactIds>wildfly-dist</includeArtifactIds>
                  <outputDirectory>${project.build.directory}/</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
              <execution>
                <id>deploy-war</id>
                <phase>install</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <outputDirectory>${wf.home}/standalone/deployments/</outputDirectory>
                  <resources>
                    <resource>
                      <directory>${project.build.directory}</directory>
                      <includes>
                        <include>*.war</include>
                      </includes>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <phase>install</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <tasks>
                    <echo>Run the server with inventory by${line.separator}${wf.home}/bin/standalone.sh${line.separator}${line.separator}</echo>
                  </tasks>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
-->
  </profiles>
</project>
