<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2015 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.groupon.api</groupId>
  <artifactId>api-parent-pom</artifactId>
  <packaging>pom</packaging>
  <name>Groupon API Parent Pom</name>
  <description>Standardized set of build tool configurations for Groupon API projects</description>
  <url>https://github.com/groupon/api-parent-pom</url>
  <version>1.0.11</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>alessandrorossi</id>
      <email>arossi@groupon.com</email>
      <organization>Groupon</organization>
      <organizationUrl>http://www.groupon.com</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>alexandrecampelo</id>
      <email>acampelo@groupon.com</email>
      <organization>Groupon</organization>
      <organizationUrl>http://www.groupon.com</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>gilmarkham</id>
      <email>gilligan@groupon.com</email>
      <organization>Groupon</organization>
      <organizationUrl>http://www.groupon.com</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>namratalele</id>
      <email>nlele@groupon.com</email>
      <organization>Groupon</organization>
      <organizationUrl>http://www.groupon.com</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>stuartsiegrist</id>
      <email>fsiegrist@groupon.com</email>
      <organization>Groupon</organization>
      <organizationUrl>http://www.groupon.com</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>swatikumar</id>
      <email>swkumar@groupon.com</email>
      <organization>Groupon</organization>
      <organizationUrl>http://www.groupon.com</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>trevormack</id>
      <email>tmack@groupon.com</email>
      <organization>Groupon</organization>
      <organizationUrl>http://www.groupon.com</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>villekoskela</id>
      <email>vkoskela@groupon.com</email>
      <organization>Groupon</organization>
      <organizationUrl>http://www.groupon.com</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:groupon/api-parent-pom.git</connection>
    <developerConnection>scm:git:git@github.com:groupon/api-parent-pom.git</developerConnection>
    <url>https://github.com/groupon/api-parent-pom</url>
    <tag>api-parent-pom-1.0.11</tag>
  </scm>

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

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

    <!--Dependency versions-->
    <build-resources.version>1.4.4</build-resources.version>
    <checkstyle.version>6.9</checkstyle.version>

    <!--Coverage Settings-->
    <jacoco.check.line.coverage>0.0</jacoco.check.line.coverage>
    <jacoco.check.branch.coverage>0.0</jacoco.check.branch.coverage>

    <!-- Deploy Plugin -->
    <!-- NOTE: True by default to faciliate use of nexus-staging-maven-plugin -->
    <skipDeploy>true</skipDeploy>

    <!--Plugin versions-->
    <maven.buildnumber.plugin.version>1.3</maven.buildnumber.plugin.version>
    <maven.checkstyle.plugin.version>2.16</maven.checkstyle.plugin.version>
    <maven.compiler.plugin.version>3.2</maven.compiler.plugin.version>
    <maven.deploy.plugin.version>2.8.2</maven.deploy.plugin.version>
    <maven.failsafe.plugin.version>2.18.1</maven.failsafe.plugin.version>
    <maven.findbugs.plugin.version>3.0.2</maven.findbugs.plugin.version>
    <maven.gpg.plugin.version>1.6</maven.gpg.plugin.version>
    <maven.jacoco.plugin.version>0.7.5.201505241946</maven.jacoco.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>
    <nexus.staging.plugin.version>1.6.6</nexus.staging.plugin.version>
  </properties>

  <profiles>
    <profile>
      <id>ci</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <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>groupon-api</keyname>
                  <passphraseServerId>groupon-api</passphraseServerId>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>default-deploy</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <configuration>
              <failOnError>false</failOnError>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <configuration>
              <failOnViolation>false</failOnViolation>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ci-strict</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <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>groupon-api</keyname>
                  <passphraseServerId>groupon-api</passphraseServerId>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>default-deploy</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
          </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>
            <showDeprecation>true</showDeprecation>
            <showWarnings>true</showWarnings>
            <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.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-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>api_coding_conventions.xml</configLocation>
                <includeTestSourceDirectory>true</includeTestSourceDirectory>
                <propertyExpansion>suppressions.file=${project.build.directory}/checkstyle-suppressions.xml
                </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.groupon.api</groupId>
              <artifactId>build-resources</artifactId>
              <version>${build-resources.version}</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${maven.jacoco.plugin.version}</version>
          <executions>
            <execution>
              <id>default-prepare-agent</id>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
            </execution>
            <execution>
              <id>default-report</id>
              <phase>prepare-package</phase>
              <goals>
                <goal>report</goal>
              </goals>
            </execution>
            <execution>
              <id>default-check</id>
              <goals>
                <goal>check</goal>
              </goals>
              <configuration>
                <rules>
                  <rule>
                    <element>BUNDLE</element>
                    <limits>
                      <limit>
                        <counter>LINE</counter>
                        <value>COVEREDRATIO</value>
                        <minimum>${jacoco.check.line.coverage}</minimum>
                      </limit>
                      <limit>
                        <counter>BRANCH</counter>
                        <value>COVEREDRATIO</value>
                        <minimum>${jacoco.check.branch.coverage}</minimum>
                      </limit>
                    </limits>
                  </rule>
                </rules>
              </configuration>
            </execution>
          </executions>
        </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-deploy-plugin</artifactId>
          <version>${maven.deploy.plugin.version}</version>
          <configuration>
            <skip>${skipDeploy}</skip>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>${nexus.staging.plugin.version}</version>
          <configuration>
            <serverId>ossrh</serverId>
            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
            <autoReleaseAfterClose>true</autoReleaseAfterClose>
            <keepStagingRepositoryOnFailure>true</keepStagingRepositoryOnFailure>
            <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
            <description>Project ${project.groupId}:${project.artifactId}:${project.version} at ${buildNumber}</description>
          </configuration>
        </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>
  </build>

  <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>
