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

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

  <inceptionYear>2015</inceptionYear>

  <modules>
    <module>hawkular-inventory-api</module>
    <module>hawkular-inventory-json-helper</module>
    <module>hawkular-inventory-impl-tinkerpop-parent</module>
    <module>hawkular-inventory-cdi</module>
    <module>hawkular-inventory-rest-api</module>
    <module>hawkular-inventory-bus</module>
    <module>hawkular-inventory-bus-api</module>
    <module>hawkular-inventory-dist</module>
    <module>hawkular-inventory-load-tests</module>
    <module>hawkular-inventory-itest-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>0.12.0.Final</tag>
  </scm>

  <properties>
    <version.org.hawkular.accounts>2.0.10.Final</version.org.hawkular.accounts>
    <version.org.hawkular.commons>0.3.2.Final</version.org.hawkular.commons>

    <version.io.reactivex>1.0.8</version.io.reactivex>
    <version.com.github.fge>2.2.6</version.com.github.fge>
    <version.com.thinkaurelius.titan>0.5.4</version.com.thinkaurelius.titan>
    <version.org.apache.httpcomponents>4.3.1</version.org.apache.httpcomponents>
    <version.com.tinkerpop.gremlin>2.6.0</version.com.tinkerpop.gremlin>
    <version.org.keycloak.secretstore>1.0.4.Final</version.org.keycloak.secretstore>
    <version.com.google.code.findbugs>3.0.1</version.com.google.code.findbugs>

    <!-- 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.1</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 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>
    <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.build-helper-maven-plugin>1.9.1</version.build-helper-maven-plugin>
    <version.org.revapi.revapi-maven-plugin>0.3.10</version.org.revapi.revapi-maven-plugin>
    <version.org.revapi.revapi-java>0.5.2</version.org.revapi.revapi-java>

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


  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.wildfly.bom</groupId>
        <artifactId>wildfly-javaee7</artifactId>
        <version>${version.org.wildfly}</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>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${version.com.google.guava}</version>
      </dependency>

      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>jsr305</artifactId>
        <version>${version.com.google.code.findbugs}</version>
      </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>

      <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>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <preparationGoals>clean verify</preparationGoals>
          <arguments>-Pitest</arguments>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>api-check</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>

      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>${version.build-helper-maven-plugin}</version>
            <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" : {
                      "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 and errors in Jackson
                          //
                          //we're also excluding anything found in the inventory API. This is because most
                          //of the other modules depend on it and we don't want to analyze the inventory API again
                          //as part of the check of those modules.
                          "exclude": ["com.fasterxml.jackson.core.*",
                                      "org.hawkular.inventory:hawkular-inventory-api:.*"]
                        },
                        "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>
            </configuration>
            <executions>
              <execution>
                <id>api-check</id>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
