<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2014 Groupon.com
  ~
  ~ 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>
  <groupId>com.arpnetworking.build</groupId>
  <artifactId>arpnetworking-parent-pom</artifactId>
  <packaging>pom</packaging>
  <name>ArpNetworking Parent POM</name>
  <description>A parent pom file used for ArpNetworking builds.</description>
  <url>https://github.com/arpnetworking/arpnetworking-parent-pom</url>
  <version>1.0.1</version>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>brandonarp</id>
      <email>brandonarp@gmail.com</email>
      <organization>Arp Networking</organization>
      <organizationUrl>http://www.arpnetworking.com</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:ArpNetworking/arpnetworking-parent-pom.git</connection>
    <developerConnection>scm:git:git@github.com:ArpNetworking/arpnetworking-parent-pom.git</developerConnection>
    <url>https://github.com/arpnetworking/arpnetworking-parent-pom</url>
    <tag>arpnetworking-parent-pom-1.0.1</tag>
  </scm>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <!-- Compiler Settings -->
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>

    <!--Dependency versions-->
    <build-resources.version>1.0.1</build-resources.version>
    <checkstyle.version>6.4.1</checkstyle.version>

    <!--Plugin versions-->
    <maven.buildnumber.plugin.version>1.3</maven.buildnumber.plugin.version>
    <maven.checkstyle.plugin.version>2.15</maven.checkstyle.plugin.version>
    <maven.compiler.plugin.version>3.2</maven.compiler.plugin.version>
    <maven.failsafe.plugin.version>2.18.1</maven.failsafe.plugin.version>
    <maven.findbugs.plugin.version>3.0.0</maven.findbugs.plugin.version>
    <maven.javadoc.plugin.version>2.10.1</maven.javadoc.plugin.version>
    <maven.release.plugin.version>2.5</maven.release.plugin.version>
    <maven.resources.plugin.version>2.6</maven.resources.plugin.version>
    <maven.source.plugin.version>2.4</maven.source.plugin.version>
    <maven.surefire.plugin.version>2.18.1</maven.surefire.plugin.version>
    <maven.surefire.report.plugin.version>2.18.1</maven.surefire.report.plugin.version>
    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
  </properties>

  <profiles>
    <profile>
      <id>ci</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <version>${maven.findbugs.plugin.version}</version>
            <executions>
              <execution>
                <id>findbugs-check</id>
                <phase>verify</phase>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <effort>Max</effort>
              <threshold>Low</threshold>
              <failOnError>true</failOnError>
              <xmlOutput>true</xmlOutput>
              <xmlOutputDirectory>${project.build.directory}</xmlOutputDirectory>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <keyname>arpnet</keyname>
                  <passphraseServerId>arpnet</passphraseServerId>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <pluginManagement>
      <plugins>
        <!-- Other plugins required by the build -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven.compiler.plugin.version}</version>
          <configuration>
            <compilerArgs>
              <arg>-Xlint:all</arg>
              <arg>-Werror</arg>
            </compilerArgs>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${maven.resources.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven.surefire.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-report-plugin</artifactId>
          <version>${maven.surefire.report.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${maven.failsafe.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${maven.checkstyle.plugin.version}</version>
          <executions>
            <execution>
              <id>checkstyle-check</id>
              <phase>verify</phase>
              <goals>
                <goal>check</goal>
                <goal>checkstyle</goal>
                <goal>checkstyle-aggregate</goal>
              </goals>
              <configuration>
                <consoleOutput>true</consoleOutput>
                <logViolationsToConsole>true</logViolationsToConsole>
                <failOnViolation>true</failOnViolation>
                <maxAllowedViolations>0</maxAllowedViolations>
                <configLocation>checkstyle.xml</configLocation>
                <includeTestSourceDirectory>true</includeTestSourceDirectory>
                <propertyExpansion>suppressions.file=${project.build.directory}/checkstyle-suppressions.xml</propertyExpansion>
                <propertyExpansion>samedir=${project.build.directory}</propertyExpansion>
                <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
                <linkXRef>false</linkXRef>
              </configuration>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>${checkstyle.version}</version>
            </dependency>
            <dependency>
              <groupId>com.arpnetworking.build</groupId>
              <artifactId>build-resources</artifactId>
              <version>${build-resources.version}</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>buildnumber-maven-plugin</artifactId>
          <version>${maven.buildnumber.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${maven.release.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven.source.plugin.version}</version>
          <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>
          <version>${maven.javadoc.plugin.version}</version>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack-build-resources</id>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
              <outputDirectory>${project.build.directory}</outputDirectory>
              <includeArtifactIds>build-resources</includeArtifactIds>
              <includeGroupIds>com.arpnetworking.build</includeGroupIds>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>com.arpnetworking.build</groupId>
      <artifactId>build-resources</artifactId>
      <version>${build-resources.version}</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>
</project>
