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

    Copyright © 2013 Sebastian Hoß <mail@shoss.de>
    This work is free. You can redistribute it and/or modify it under the
    terms of the Do What The Fuck You Want To Public License, Version 2,
    as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.

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

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!--                                 PARENT                                  -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <parent>
    <groupId>com.github.sebhoss</groupId>
    <artifactId>superpom</artifactId>
    <version>2.0.4</version>
  </parent>

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!--                               INFORMATIONS                              -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <artifactId>java-parent</artifactId>
  <version>1.0.11</version>
  <packaging>pom</packaging>
  <inceptionYear>2013</inceptionYear>
  <url>https://github.com/sebhoss/java-parent</url>
  <name>Java Parent</name>
  <description>Parent POM for all Java-based projects</description>

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!--                                  SOURCE                                 -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <scm>
    <connection>scm:git:git://github.com/sebhoss/java-parent.git</connection>
    <developerConnection>scm:git:git@github.com:sebhoss/java-parent.git</developerConnection>
    <tag>master</tag>
    <url>${project.url}</url>
  </scm>

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!--                                PROPERTIES                               -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <properties>
    <version.jdk>1.8</version.jdk>

    <coverage>1.00000</coverage>
    <pmd.cpd.tokens>50</pmd.cpd.tokens>
  </properties>

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!--                                   BUILD                                 -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.10.1</version>
        <configuration>
          <outputDirectory>${project.build.directory}/api</outputDirectory>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.2</version>
        <configuration>
          <source>${version.jdk}</source>
          <target>${version.jdk}</target>
          <compilerId>jdt</compilerId>
          <compilerArguments>
            <properties>${project.basedir}/.settings/org.eclipse.jdt.core.prefs</properties>
          </compilerArguments>
          <compilerArgument>-parameters</compilerArgument>
        </configuration>
        <dependencies>
          <!-- This dependency provides the implementation of compiler "jdt": -->
          <dependency>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-compiler-jdt</artifactId>
            <version>0.22.0</version>
          </dependency>
        </dependencies>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.5.3</version>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <instructions>
            <Bundle-Copyright>${project.developers[0].name} (${project.developers[0].email})</Bundle-Copyright>
            <Bundle-DocURL>${project.url}</Bundle-DocURL>
          </instructions>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
          <effort>Max</effort>
          <threshold>Low</threshold>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <failurePriority>0</failurePriority>
          <minimumTokens>${pmd.cpd.tokens}</minimumTokens>
          <targetJdk>${version.jdk}</targetJdk>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
              <goal>cpd-check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.7.2.201409121644</version>
        <executions>
          <execution>
            <id>prepare-coverage-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>check-coverage</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <rules>
                <rule>
                  <element>CLASS</element>
                  <excludes>
                    <exclude>*Test</exclude>
                  </excludes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>${coverage}</minimum>
                    </limit>
                  </limits>
                </rule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.eluder.coveralls</groupId>
        <artifactId>coveralls-maven-plugin</artifactId>
        <version>3.0.1</version>
        <configuration>
          <repoToken>${COVERALLS_TOKEN}</repoToken>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-remote-resources-plugin</artifactId>
        <version>1.5</version>
        <executions>
          <execution>
            <id>jdt-settings</id>
            <goals>
              <goal>process</goal>
            </goals>
            <configuration>
              <attachToMain>false</attachToMain>
              <attachToTest>false</attachToTest>
              <resourceBundles>
                <resourceBundle>com.github.sebhoss:jdt-settings:2.0.0</resourceBundle>
              </resourceBundles>
              <outputDirectory>${project.basedir}/.settings</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>com.ning.maven.plugins</groupId>
        <artifactId>maven-duplicate-finder-plugin</artifactId>
        <version>1.0.9</version>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <failBuildInCaseOfConflict>true</failBuildInCaseOfConflict>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.ning.maven.plugins</groupId>
        <artifactId>maven-dependency-versions-check-plugin</artifactId>
        <version>2.0.2</version>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <failBuildInCaseOfConflict>true</failBuildInCaseOfConflict>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.9</version>
        <executions>
          <execution>
            <goals>
              <goal>analyze-only</goal>
              <goal>analyze-duplicate</goal>
              <goal>analyze-dep-mgt</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <failOnWarning>true</failOnWarning>
              <!--
                Ignore common annotations because @SuppressWarnings is not retained
                in byte code. There the plugin detects a false positive.
              <usedDependencies>
                <usedDependency>com.github.sebhoss:suppress-warnings</usedDependency>
              </usedDependencies>
               -->
        </configuration>
      </plugin>
    </plugins>
  </build>

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!--                                 REPORTING                               -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.18.1</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>3.3</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.10.1</version>
        <configuration>
          <outputDirectory>${project.build.directory}/api</outputDirectory>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>3.0.0</version>
      </plugin>
    </plugins>
  </reporting>
</project>
