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

    Copyright 2014-2015 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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.rhq.metrics</groupId>
  <artifactId>rhq-metrics-parent</artifactId>
  <version>0.2.7</version>
  <packaging>pom</packaging>

  <name>RHQ Metrics</name>
  <description>RHQ Metrics is a metrics collection, aggregation, visualization framework.</description>
  <url>https://community.jboss.org/en/rhq/rhq-metrics</url>
  <inceptionYear>2014</inceptionYear>
  <organization>
    <name>Red Hat, Inc.</name>
    <url>http://redhat.com/</url>
  </organization>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Heiko W. Rupp</name>
      <email>hrupp@redhat.com</email>
      <url>http://pilhuhn.blogspot.com/</url>
      <timezone>+1</timezone>
      <properties>
        <picUrl>http://en.gravatar.com/pilhuhn</picUrl>
      </properties>
    </developer>
    <developer>
      <name>John Sanda</name>
      <url>http://johnsanda.blogspot.com/</url>
      <timezone>-5</timezone>
    </developer>
    <developer>
      <name>Mike Thompson</name>
      <timezone>-8</timezone>
    </developer>
    <developer>
      <name>Heiko Braun</name>
      <timezone>+1</timezone>
    </developer>
    <developer>
      <name>Stefan Negrea</name>
      <timezone>-6</timezone>
    </developer>
  </developers>

  <modules>
    <module>test-utils</module>
    <module>core-api</module>
    <module>embedded-cassandra</module>
    <module>metrics-core</module>
    <module>rest-servlet</module>
    <module>clients</module>
    <module>rest-tests</module>
    <module>ui/explorer</module>
    <module>ui/console</module>
  </modules>

  <scm>
    <connection>scm:git:ssh://github.com/rhq-project/rhq-metrics</connection>
    <developerConnection>scm:git:ssh://github.com/rhq-project/rhq-metrics</developerConnection>
    <url>https://github.com/rhq-project/rhq-metrics</url>
  </scm>
  <ciManagement>
    <system>Travis-ci</system>
    <url>https://travis-ci.org/rhq-project/rhq-metrics</url>
  </ciManagement>
  <distributionManagement>

    <snapshotRepository>
      <id>jboss-snapshots-repository</id>
      <name>JBoss Snapshots Repository</name>
      <url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>

    <repository>
      <id>jboss-releases-repository</id>
      <name>JBoss Releases Repository</name>
      <url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/</url>
    </repository>

    <site>
      <id>local-site-tmp</id>
      <name>RHQ-metrics</name>
      <url>file:///tmp/rhq-metrics-site</url>
    </site>

  </distributionManagement>

  <properties>
    <maven.test.skip>${skipTests}</maven.test.skip>

    <test.keyspace>rhqtest</test.keyspace>
    <nodes>127.0.0.1</nodes>

    <datastax.driver.version>2.1.2</datastax.driver.version>
    <joda.time.version>2.3</joda.time.version>
    <testng.version>6.8.8</testng.version>
    <slf4j.version>1.7.7</slf4j.version>
    <log4j.version>1.2.17</log4j.version>
    <vertx.version>2.1RC3</vertx.version>
    <vertx.testtools.version>2.0.3-final</vertx.testtools.version>
    <jackson.version>2.3.2</jackson.version>
    <trove4j.version>3.0.3</trove4j.version>
    <google.guava.version>16.0.1</google.guava.version>
    <antlr.version>4.5</antlr.version>

    <version.wildfly>8.2.0.Final</version.wildfly>
    <findbugs.version>3.0.0</findbugs.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <checkstyle.plugin.version>2.13</checkstyle.plugin.version>
    <checkstyle.version>6.1.1</checkstyle.version>
    <checkstyleConsoleOutput>true</checkstyleConsoleOutput>
    <checkstyleFailOnError>true</checkstyleFailOnError>
    <!-- the default value pointing at suppressions.xml in rhq-checkstyle-config dependency -->
    <checkstyle.suppressions.file>hawkular-checkstyle/suppressions.xml</checkstyle.suppressions.file>
    <version.org.hawkular.hawkular-build-tools>5</version.org.hawkular.hawkular-build-tools>
    <license.failIfMissing>true</license.failIfMissing>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${google.guava.version}</version>
      </dependency>
      <dependency>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-runtime</artifactId>
        <version>${antlr.version}</version>
      </dependency>
      <!-- Tests dependencies -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>1.7.0</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>1.10.19</version>
        <scope>test</scope>
      </dependency>
      <!-- TestNG is not RHQ-Metrics main testing framework -->
      <!-- While still needed to run legacy tests, new tests should be based upon jUnit -->
      <!-- It can still be used when there's a good reason (compatibility with a testing framework for example) -->
      <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>${testng.version}</version>
        <scope>test</scope>
      </dependency>
      <!-- Other -->
      <dependency>
        <groupId>org.hawkular</groupId>
        <artifactId>hawkular-build-tools</artifactId>
        <version>${version.org.hawkular.hawkular-build-tools}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>2.6</version>
        </plugin>
        <plugin>
          <groupId>org.antlr</groupId>
          <artifactId>antlr4-maven-plugin</artifactId>
          <version>${antlr.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>2.9</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.2</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>animal-sniffer-maven-plugin</artifactId>
          <version>1.11</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.17</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.5</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>2.5</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.7</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>2.5.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.18.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.gmaven</groupId>
          <artifactId>groovy-maven-plugin</artifactId>
          <version>2.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>1.3.2</version>
        </plugin>
        <plugin>
          <groupId>org.wildfly.plugins</groupId>
          <artifactId>wildfly-maven-plugin</artifactId>
          <version>1.0.2.Final</version>
          <configuration>
            <version>${version.wildfly}</version>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${checkstyle.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>2.7</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.3.1</version>
        <executions>
          <execution>
            <id>enforce-rules</id>
            <goals>
              <goal>enforce</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <rules>
            <requireMavenVersion>
              <version>[3.0.4,)</version>
            </requireMavenVersion>
            <requireJavaVersion>
              <version>[1.8,)</version>
            </requireJavaVersion>
            <requireNoRepositories/>
            <requirePluginVersions/>
          </rules>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
          <showWarnings>true</showWarnings>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <!-- This depedency upgrade is a workaround for MANIMALSNIFFER-45 -->
        <!-- MANIMALSNIFFER-45 only affects users building with a JDK 8 -->
        <!-- It can be removed once MANIMALSNIFFER-45 is fixed -->
        <!-- See https://jira.codehaus.org/browse/MANIMALSNIFFER-45 -->
        <dependencies>
          <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm-all</artifactId>
            <version>5.0.3</version>
          </dependency>
        </dependencies>
        <!-- Copy paste and uncomment the following block in sub-projects where Java 7 compatibility is required -->
        <!--<executions>-->
          <!--<execution>-->
            <!--<id>java-api-check</id>-->
            <!--<configuration>-->
              <!--<signature>-->
                <!--<groupId>org.codehaus.mojo.signature</groupId>-->
                <!--<artifactId>java17</artifactId>-->
                <!--<version>1.0</version>-->
              <!--</signature>-->
            <!--</configuration>-->
            <!--<phase>verify</phase>-->
            <!--<goals>-->
              <!--<goal>check</goal>-->
            <!--</goals>-->
          <!--</execution>-->
        <!--</executions>-->
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>${findbugs.version}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.5.3</version>
        <extensions>true</extensions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <configLocation>hawkular-checkstyle/checkstyle.xml</configLocation>
          <consoleOutput>${checkstyleConsoleOutput}</consoleOutput>
          <failsOnError>${checkstyleFailOnError}</failsOnError>
          <!-- Make includes relative to ${basedir} -->
          <sourceDirectory>${basedir}</sourceDirectory>
          <!-- in <includes>, it is necessary to avoid using an item-initial **/ wildcard
               which pulls in also files from all submodules and target folders. We do not want
               that. We rather have to name specific root folder patterns like *.extension
               or directory/**/*.extension -->
          <includes>
            src/**/*.java,
            *.xml,
            src/**/*.xml,
            src/**/*.js,
            *.adoc,
            src/**/*.adoc,
            *.conf,
            src/**/*.conf,
            src/**/*.cql,
            src/**/*.css,
            Dockerfile,
            src/**/Dockerfile,
            src/**/*.groovy,
            *.html,
            src/**/*.html,
            src/**/*.json,
            src/**/*.js.map,
            *.md,
            src/**/*.md,
            *.properties,
            src/**/*.properties,
            *.sh,
            src/**/*.sh,
            *.txt,
            src/**/*.txt,
            src/**/*.xsl,
            *.yml,
            src/**/*.yml,
            src/**/*.yaml,
          </includes>
          <!-- to override in a submodule, just redefine the checkstyle.suppressions.file property
               in the given submodule's pom -->
          <suppressionsLocation>${checkstyle.suppressions.file}</suppressionsLocation>
          <useFile />
        </configuration>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>${checkstyle.version}</version>
          </dependency>
          <dependency>
            <groupId>org.hawkular</groupId>
            <artifactId>hawkular-build-tools</artifactId>
            <version>${version.org.hawkular.hawkular-build-tools}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>check-style</id>
            <phase>compile</phase>
            <goals>
              <goal>checkstyle</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration>
          <header>hawkular-license/jboss-apache-2-template.txt</header>
          <excludes>
            <exclude>**/.bowerrc</exclude>
            <exclude>**/.jshintrc</exclude>
            <exclude>**/LICENSE</exclude>
            <exclude>**/README</exclude>
            <exclude>**/README.*</exclude>
            <exclude>**/*.eot</exclude>
            <exclude>**/*.otf</exclude>
            <exclude>**/*.ttf</exclude>
            <exclude>**/*.svg</exclude>
            <exclude>**/*.woff</exclude>
            <exclude>**/*.html</exclude>
            <exclude>**/*.htm</exclude>
          </excludes>
          <mapping>
            <conf>SCRIPT_STYLE</conf>
            <cql>DOUBLEDASHES_STYLE</cql>
            <Dockerfile>SCRIPT_STYLE</Dockerfile>
            <g4>SLASHSTAR_STYLE</g4>
            <iql>DOUBLEDASHES_STYLE</iql>
            <jshintrc>SLASHSTAR_STYLE</jshintrc>
            <java>SLASHSTAR_STYLE</java>
            <ts>SLASHSTAR_STYLE</ts>
            <yaml>SCRIPT_STYLE</yaml>
            <yml>SCRIPT_STYLE</yml>
          </mapping>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.hawkular</groupId>
            <artifactId>hawkular-build-tools</artifactId>
            <version>${version.org.hawkular.hawkular-build-tools}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>${findbugs.version}</version>
        <configuration>
          <xmlOutput>true</xmlOutput>
          <effort>Max</effort>
          <threshold>Default</threshold>
        </configuration>
        <inherited>true</inherited>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.7</version>
        <configuration>
          <showAvatarImages>true</showAvatarImages>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.6</version>
      </plugin>
      <plugin>
        <!-- must be last plugin in the list -->
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>dashboard-maven-plugin</artifactId>
        <version>1.0.0-beta-1</version>
      </plugin>

    </plugins>

  </reporting>

  <profiles>

    <profile>
      <id>test.debug</id>
      <activation>
        <property>
          <name>test.debug</name>
        </property>
      </activation>

      <properties>
        <!-- See: http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#debugForkedProcess -->
        <maven.surefire.debug>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8797,server=y,suspend=y</maven.surefire.debug>
      </properties>
    </profile>

    <profile>
      <id>download_wildfly</id>
      <dependencies>
        <dependency>
          <groupId>org.wildfly</groupId>
          <artifactId>wildfly-dist</artifactId>
          <version>${version.wildfly}</version>
          <type>zip</type>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>publish</id>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>

