<?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-parent</artifactId>
    <version>44</version>
  </parent>

  <groupId>org.hawkular.inventory</groupId>
  <artifactId>hawkular-inventory-parent</artifactId>
  <version>1.0.2.Final</version>
  <packaging>pom</packaging>

  <inceptionYear>2015</inceptionYear>

  <modules>
    <module>hawkular-inventory-api</module>
    <module>hawkular-inventory-bus</module>
    <module>hawkular-inventory-bus-api</module>
    <module>hawkular-inventory-cdi</module>
    <module>hawkular-inventory-dist</module>
    <module>hawkular-inventory-feature-pack</module>
    <module>hawkular-inventory-impl-tinkerpop-parent</module>
    <module>hawkular-inventory-itest</module>
    <module>hawkular-inventory-json-helper</module>
    <module>hawkular-inventory-load-tests</module>
    <module>hawkular-inventory-rest-api</module>
    <module>hawkular-inventory-security-parent</module>
  </modules>

  <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>1.0.2.Final</tag>
  </scm>

  <properties>
    <version.org.hawkular.commons>0.7.10.Final</version.org.hawkular.commons>

    <version.io.reactivex>1.0.8</version.io.reactivex>
    <!-- overrides 3.1.2 from parent which produces NPE -->
    <version.com.github.kongchen.swagger-maven-plugin>3.1.1</version.com.github.kongchen.swagger-maven-plugin>
    <version.com.github.fge>2.2.6</version.com.github.fge>
    <version.com.thinkaurelius.titan>1.1.0-SNAPSHOT</version.com.thinkaurelius.titan>
    <version.com.tinkerpop.gremlin>2.6.0</version.com.tinkerpop.gremlin>
    <version.org.apache.tinkerpop>3.2.2</version.org.apache.tinkerpop>
    <version.org.umlg>1.3.0-SRC-revision-46e6886ee1136bc275c25b164a27a457218e11ea</version.org.umlg>

    <version.org.antlr>4.5.3</version.org.antlr>

    <!-- keep in sync with the WF module modules/system/layers/base/org/apache/commons/beanutils/main/ -->
    <version.commons-beanutils>1.9.2</version.commons-beanutils>
    <!-- keep in sync with the WF module modules/system/layers/base/org/apache/commons/collections/main/ -->
    <version.commons-collections>3.2.2</version.commons-collections>
    <!-- keep in sync with the WF module modules/system/layers/base/org/apache/commons/io/main/ -->
    <version.commons-io>2.4</version.commons-io>
    <!-- keep in sync with the WF module modules/system/layers/base/org/apache/commons/lang/main/ -->
    <version.commons-lang>2.6</version.commons-lang>
    <!-- keep in sync with the required version in sqlg -->
    <version.commons-lang3>3.3.1</version.commons-lang3>
    <!-- keep in sync with the WF module modules/system/layers/base/org/apache/commons/logging/main/ -->
    <version.commons-logging>1.1.1</version.commons-logging>
    <!-- keep in sync with the WF module modules/system/layers/base/org/apache/commons/pool/main/ -->
    <version.commons-pool>1.6</version.commons-pool>
    <!-- keep in sync with the WF module modules/system/layers/base/io/netty/main/ -->
    <version.io.netty>4.0.32.Final</version.io.netty>
    <version.joda-time>2.9.1</version.joda-time>
    <!-- keep in sync with the WF module modules/system/layers/base/javax/mail/api/main/ -->
    <version.javax.mail>1.5.3</version.javax.mail>
    <version.javaee.spec>7.0</version.javaee.spec>

    <version.org.postgresql>9.4.1208</version.org.postgresql>
    <version.org.hsqldb>2.3.4</version.org.hsqldb>

    <!-- keep in sync with the WF module modules/system/layers/base/org/codehaus/jettison/main/ -->
    <version.org.codehaus.jettison>1.3.3</version.org.codehaus.jettison>

    <version.org.revapi.revapi-maven-plugin>0.6.1</version.org.revapi.revapi-maven-plugin>
    <version.org.revapi.revapi-java>0.10.2</version.org.revapi.revapi-java>

    <!-- integration tests distribution properties -->
    <test-dist-version.org.hawkular.commons>${version.org.hawkular.commons}</test-dist-version.org.hawkular.commons> <!-- C* -->

    <!-- tests -->
    <version.org.powermock>1.6.5</version.org.powermock>
  </properties>


  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.wildfly.bom</groupId>
        <artifactId>wildfly-javaee7</artifactId>
        <version>${version.org.wildfly.bom}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>com.github.fge</groupId>
        <artifactId>json-schema-validator</artifactId>
        <version>${version.com.github.fge}</version>
        <exclusions>
          <exclusion>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
          </exclusion>
          <exclusion>
            <groupId>javax.mail</groupId>
            <artifactId>mailapi</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>commons-beanutils</groupId>
        <artifactId>commons-beanutils</artifactId>
        <version>${version.commons-beanutils}</version>
      </dependency>

      <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>${version.commons-collections}</version>
      </dependency>

      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>${version.commons-io}</version>
      </dependency>

      <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>${version.commons-lang}</version>
      </dependency>

      <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>${version.commons-logging}</version>
      </dependency>

      <dependency>
        <groupId>commons-pool</groupId>
        <artifactId>commons-pool</artifactId>
        <version>${version.commons-pool}</version>
      </dependency>

      <!-- netty managed here so that this version is preferred over the ones pulled by our dependencies -->
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-all</artifactId>
        <version>${version.io.netty}</version>
      </dependency>

      <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>javax.mail-api</artifactId>
        <version>${version.javax.mail}</version>
      </dependency>

      <dependency>
        <groupId>joda-time</groupId>
        <artifactId>joda-time</artifactId>
        <version>${version.joda-time}</version>
      </dependency>

      <!-- jettison managed here so that this version is preferred over the ones pulled by our dependencies -->
      <dependency>
        <groupId>org.codehaus.jettison</groupId>
        <artifactId>jettison</artifactId>
        <version>${version.org.codehaus.jettison}</version>
        <!-- There is a WildFly module - prefferably pull as <scope>provided</scope> -->
      </dependency>

      <dependency>
        <groupId>org.hawkular.commons</groupId>
        <artifactId>hawkular-inventory-paths</artifactId>
        <version>${version.org.hawkular.commons}</version>
        <!-- There is a WildFly module - prefferably pull as <scope>provided</scope> -->
      </dependency>

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

      <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-module-junit4</artifactId>
        <version>${version.org.powermock}</version>
      </dependency>

      <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-api-mockito</artifactId>
        <version>${version.org.powermock}</version>
      </dependency>

      <dependency>
        <groupId>org.hawkular.commons</groupId>
        <artifactId>hawkular-cors-jaxrs-filter</artifactId>
        <version>${version.org.hawkular.commons}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <preparationGoals>clean verify</preparationGoals>
          <arguments>-Pitest</arguments>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration>
          <excludes combine.children="append">
            <exclude>**/travis_wait_*.log</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.l2x6.maven.srcdeps</groupId>
        <artifactId>srcdeps-maven-plugin</artifactId>
        <version>${version.srcdeps-maven-plugin}</version>
        <extensions>true</extensions>
        <configuration>
          <repositories>
            <repository>
              <id>sqlg</id>
              <selectors>
                <selector>org.umlg</selector>
              </selectors>
              <url>scm:git:https://github.com/metlos/sqlg.git</url>
              <buildArgs>
                <!-- the tests take a loooong time -->
                <buildArg>-DskipTests</buildArg>
                <buildArg>-Dsqlg.version=${version.org.umlg}</buildArg>
                <buildArg>-Dtinkerpop.version=${version.org.apache.tinkerpop}</buildArg>
              </buildArgs>
            </repository>
          </repositories>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.l2x6.maven.srcdeps</groupId>
            <artifactId>srcdeps-maven-plugin</artifactId>
            <version>${version.srcdeps-maven-plugin}</version>
            <extensions>true</extensions>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>api-check</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>parse-version</id>
                <goals>
                  <goal>parse-version</goal>
                </goals>
                <phase>validate</phase>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.revapi</groupId>
            <artifactId>revapi-maven-plugin</artifactId>
            <version>${version.org.revapi.revapi-maven-plugin}</version>
            <dependencies>
              <dependency>
                <groupId>org.revapi</groupId>
                <artifactId>revapi-java</artifactId>
                <version>${version.org.revapi.revapi-java}</version>
              </dependency>
            </dependencies>
            <configuration>
              <failOnMissingConfigurationFiles>false</failOnMissingConfigurationFiles>
              <analysisConfiguration>
                <![CDATA[
                  {
                    "revapi" : {
                      "semver": {
                        "ignore": {
                          "enabled": true
                        }
                      },
                      "java" : {
                        "missing-classes" : {
                          "behavior" : "report"
                        },
                        "ignore": {
                          "annotations": {
                            "regex": true,
                            "annotations": ["@org\\.jboss\\.logging\\.annotations\\.MessageLogger.*", "@org\\.jboss\\.logging\\.annotations\\.Message.*"]
                          }
                        }
                      },
                      "filter": {
                        "archives": {
                          //We're ignoring all API incompatibilities outside of the currently built module
                          //This is not completely safe, because it hides the API incompatibilities dragged into the API
                          //from changed versions of dependencies, but this is by far the easiest approach to take.
                          "include": ["${project.groupId}:${project.artifactId}:.*"]
                        },
                        "elements": {
                          //exclude the elements generated by jboss logging
                          "exclude": [".*_\\$logger.*"]
                        }
                        }
                    }
                  }
                ]]>
              </analysisConfiguration>
              <analysisConfigurationFiles>
                <configurationFile>
                  <path>api-changes.json</path>
                  <roots>
                    <root>
                      ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.Final
                    </root>
                  </roots>
                </configurationFile>
              </analysisConfigurationFiles>
              <singleVersionForAllModules>true</singleVersionForAllModules>
            </configuration>
            <executions>
              <execution>
                <id>api-check</id>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
