<?xml version="1.0" encoding="UTF-8"?>
<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>
    <artifactId>DeploymentConfiguration</artifactId>
    <groupId>org.e-hoffman.build</groupId>
    <version>1.0.4</version>
  </parent>
  <artifactId>OpenSourceParent</artifactId>
  <packaging>pom</packaging>
  <name>${project.artifactId}</name>
  <description>A parent pom for opensource projects.  It only configures plugins, some extensively, but leaves the project classpath alone.</description>
  <prerequisites>
    <maven>3.1</maven>
  </prerequisites>
  <scm>
    <connection>${project.parent.scm.connection}</connection>
    <developerConnection>${project.parent.scm.developerConnection}</developerConnection>
  </scm>
  <properties>
    <!-- static.analysis.conf.version this need to be manually updated with each release unfortunately -->
    <static.analysis.conf.version>1.0.4</static.analysis.conf.version>
    <outputEncoding>UTF-8</outputEncoding>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <checkstyle.version>2.12.1</checkstyle.version>
    <checkstyle.xml>checkstyle.xml</checkstyle.xml>
    <duplicatefinder.version>1.0.7</duplicatefinder.version>
    <findbugs.version>3.0.0</findbugs.version>
    <github.site.location>${project.version}/OpenSourceParent</github.site.location>
    <java.version>1.7</java.version>
    <jacoco.version>0.7.1.201405082137</jacoco.version>
    <jdepend.version>2.0</jdepend.version>
    <javadoc.version>2.9.1</javadoc.version>
    <pmd.version>3.2</pmd.version>
    <pmd.rules>rulesets/java/pmd-0.xml</pmd.rules>
    <pmd.fail>true</pmd.fail>
    <pmd.priority>5</pmd.priority>
    <sortpom.version>2.3.0</sortpom.version>
    <surefire.version>2.16</surefire.version>
    <semver.version>0.9.29</semver.version>
    <semver.enforcer>BACKWARD_COMPATIBLE_IMPLEMENTER</semver.enforcer>
    <semver.details>true</semver.details>
  </properties>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${checkstyle.version}</version>
          <executions>
            <execution>
              <phase>verify</phase>
              <goals>
                <goal>checkstyle</goal>
              </goals>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>org.e-hoffman.build</groupId>
              <artifactId>StaticAnalysisConf</artifactId>
              <version>${static.analysis.conf.version}</version>
            </dependency>
          </dependencies>
          <configuration>
            <configLocation>${checkstyle.xml}</configLocation>
            <includeTestSourceDirectory>false</includeTestSourceDirectory>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-pmd-plugin</artifactId>
          <version>${pmd.version}</version>
          <executions>
            <execution>
              <id>check</id>
              <phase>compile</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>org.e-hoffman.build</groupId>
              <artifactId>StaticAnalysisConf</artifactId>
              <version>${static.analysis.conf.version}</version>
            </dependency>
          </dependencies>
          <configuration>
            <rulesets>
              <ruleset>${pmd.rules}</ruleset>
            </rulesets>
            <linkXref>true</linkXref>
            <printFailingErrors>true</printFailingErrors>
            <failOnViolation>${pmd.fail}</failOnViolation>
            <failurePriority>${pmd.priority}</failurePriority>
            <targetJdk>${java.version}</targetJdk>
            <includeTests>true</includeTests>
            <excludeRoots>
              <excludeRoot>${project.build.directory}/generated-sources/apt/</excludeRoot>
              <excludeRoot>${project.build.directory}/generated-sources/apt-test/</excludeRoot>
            </excludeRoots>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <version>${findbugs.version}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>1.8</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>1.3.2</version>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${jacoco.version}</version>
          <executions>
            <execution>
              <id>jacoco-initialize</id>
              <phase>initialize</phase>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
            </execution>
            <execution>
              <id>jacoco-site</id>
              <phase>package</phase>
              <goals>
                <goal>report</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <dependencies>
            <dependency>
              <groupId>org.e-hoffman.build</groupId>
              <artifactId>StaticAnalysisConf</artifactId>
              <version>${static.analysis.conf.version}</version>
            </dependency>
          </dependencies>
          <configuration>
            <relativizeDecorationLinks>false</relativizeDecorationLinks>
            <attach>false</attach>
            <reportPlugins>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                  <linkOnly>true</linkOnly>
                </configuration>
                <reportSets>
                  <reportSet>
                    <reports>
                      <report>index</report>
                      <report>project-team</report>
                      <report>cim</report>
                      <report>mailing-list</report>
                      <report>modules</report>
                      <report>issue-tracking</report>
                      <report>license</report>
                      <report>dependencies</report>
                      <report>dependency-convergence</report>
                      <report>dependency-info</report>
                      <report>dependency-management</report>
                      <report>distribution-management</report>
                      <report>help</report>
                      <report>plugin-management</report>
                      <report>plugins</report>
                      <report>summary</report>
                      <report>scm</report>
                    </reports>
                  </reportSet>
                </reportSets>
              </plugin>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>2.4</version>
              </plugin>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <configuration>
                  <show>package</show>
                </configuration>
              </plugin>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>${pmd.version}</version>
                <configuration>
                  <rulesets>
                    <ruleset>${pmd.rules}</ruleset>
                  </rulesets>
                  <linkXref>true</linkXref>
                  <targetJdk>${java.version}</targetJdk>
                  <excludeRoots>
                    <excludeRoot>${project.build.directory}/generated-sources/apt/</excludeRoot>
                    <excludeRoot>${project.build.directory}/generated-sources/apt-test/</excludeRoot>
                  </excludeRoots>
                </configuration>
              </plugin>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${checkstyle.version}</version>
                <configuration>
                  <configLocation>${checkstyle.xml}</configLocation>
                </configuration>
              </plugin>
              <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>${findbugs.version}</version>
              </plugin>
              <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jdepend-maven-plugin</artifactId>
                <version>${jdepend.version}</version>
              </plugin>
              <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
              </plugin>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>${surefire.version}</version>
              </plugin>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                  <lineLength>132</lineLength>
                </configuration>
              </plugin>
            </reportPlugins>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.3</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <phase>verify</phase>
              <goals>
                <goal>jar-no-fork</goal>
                <goal>test-jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${surefire.version}</version>
          <configuration>
            <parallel>classesAndMethods</parallel>
            <useUnlimitedThreads>true</useUnlimitedThreads>
            <includes>
              <include>**/*.java</include>
            </includes>
            <useFile>false</useFile>
            <trimStackTrace>false</trimStackTrace>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${surefire.version}</version>
          <configuration>
            <parallel>classesAndMethods</parallel>
            <includes>
              <include>**/*.java</include>
            </includes>
            <useFile>false</useFile>
            <trimStackTrace>false</trimStackTrace>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${javadoc.version}</version>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
                <goal>test-jar</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <show>package</show>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.bsc.maven</groupId>
          <artifactId>maven-processor-plugin</artifactId>
          <version>2.2.4</version>
          <executions>
            <execution>
              <id>process</id>
              <phase>generate-sources</phase>
              <goals>
                <goal>process</goal>
              </goals>
            </execution>
            <execution>
              <id>process-test</id>
              <phase>generate-test-sources</phase>
              <goals>
                <goal>process-test</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.1</version>
          <configuration>
            <source>${java.version}</source>
            <target>${java.version}</target>
            <!-- Disable annotation processors during normal compilation -->
            <compilerArgument>-proc:none</compilerArgument>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-report-plugin</artifactId>
          <version>${surefire.version}</version>
          <executions>
            <execution>
              <phase>test</phase>
              <goals>
                <goal>report-only</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.3.1</version>
          <executions>
            <execution>
              <id>verify</id>
              <phase>validate</phase>
              <goals>
                <goal>enforce</goal>
              </goals>
              <inherited>true</inherited>
              <configuration>
                <failFast>true</failFast>
                <rules>
                  <DependencyConvergence></DependencyConvergence>
                  <requireReleaseDeps>
                    <onlyWhenRelease>true</onlyWhenRelease>
                  </requireReleaseDeps>
                  <requireJavaVersion>
                    <version>${java.version}</version>
                  </requireJavaVersion>
                </rules>
              </configuration>
            </execution>
            <execution>
              <id>check</id>
              <phase>verify</phase>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <ignoreCache>true</ignoreCache>
                <rules>
                  <requireSemanticVersioningConformance implementation="org.semver.enforcer.RequireSemanticVersioningConformance">
                    <dumpDetails>${semver.details}</dumpDetails>
                  </requireSemanticVersioningConformance>
                </rules>
              </configuration>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>org.semver</groupId>
              <artifactId>enforcer-rule</artifactId>
              <version>0.9.26</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>com.google.code.sortpom</groupId>
          <artifactId>maven-sortpom-plugin</artifactId>
          <version>${sortpom.version}</version>
          <executions>
            <execution>
              <phase>validate</phase>
              <goals>
                <goal>verify</goal>
              </goals>
              <configuration>
                <expandEmptyElements>false</expandEmptyElements>
                <keepBlankLines>true</keepBlankLines>
                <lineSeparator>\n</lineSeparator>
                <nrOfIndentSpace>2</nrOfIndentSpace>
                <verifyFail>Stop</verifyFail>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>com.ning.maven.plugins</groupId>
          <artifactId>maven-duplicate-finder-plugin</artifactId>
          <version>${duplicatefinder.version}</version>
          <executions>
            <execution>
              <phase>verify</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <failBuildInCaseOfConflict>true</failBuildInCaseOfConflict>
            <ignoredResources combine.children="append">
              <ignoredResource>about.html</ignoredResource>
              <ignoredResource>META-INF/README</ignoredResource>
              <ignoredResource>META-INF/beans\.xml</ignoredResource>
              <ignoredResource>META-INF/persistence\.xml</ignoredResource>
              <ignoredResource>META-INF/BCKEY.*</ignoredResource>
              <ignoredResource>META-INF/eclipse.inf</ignoredResource>
              <ignoredResource>META-INF/ECLIPSEF.*</ignoredResource>
              <ignoredResource>plugin.properties</ignoredResource>
              <ignoredResource>META-INF/mailcap</ignoredResource>
              <ignoredResource>about_files/.*</ignoredResource>
            </ignoredResources>
            <exceptions combine.children="append">
              <exception>
                <conflictingDependencies>
                  <dependency>
                    <groupId>jaxen</groupId>
                    <artifactId>jaxen</artifactId>
                    <version>1.1.1</version>
                  </dependency>
                  <dependency>
                    <groupId>xerces</groupId>
                    <artifactId>xmlParserAPIs</artifactId>
                    <version>2.6.2</version>
                  </dependency>
                  <dependency>
                    <groupId>xml-apis</groupId>
                    <artifactId>xml-apis</artifactId>
                    <version>[1.3.02,1.3.03]</version>
                  </dependency>
                  <dependency>
                    <groupId>xmlrpc</groupId>
                    <artifactId>xmlrpc</artifactId>
                    <version>2.0</version>
                  </dependency>
                  <dependency>
                    <groupId>stax</groupId>
                    <artifactId>stax-api</artifactId>
                    <version>1.0.1</version>
                  </dependency>
                  <dependency>
                    <groupId>xml-apis</groupId>
                    <artifactId>xml-apis</artifactId>
                    <version>[1.3.02,1.3.03]</version>
                  </dependency>
                  <dependency>
                    <groupId>xalan</groupId>
                    <artifactId>xalan</artifactId>
                    <version>2.6.0</version>
                  </dependency>
                </conflictingDependencies>
                <classes>
                  <class>javax.xml.XMLConstants</class>
                  <class>javax.xml.namespace.NamespaceContext</class>
                  <class>javax.xml.namespace.QName</class>
                  <class>org.apache.xmlcommons.Version</class>
                </classes>
                <packages>
                  <package>org.w3c.dom.ls</package>
                  <package>javax.xml.parsers</package>
                  <package>javax.xml.transform</package>
                  <package>org.w3c.dom</package>
                  <package>org.xml.sax</package>
                  <package>org.w3c.dom.xpath</package>
                </packages>
              </exception>
            </exceptions>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.8</version>
        <executions>
          <execution>
            <id>extract-site-resources</id>
            <phase>site</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <inherited>true</inherited>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.e-hoffman.build</groupId>
                  <artifactId>DeploymentConfiguration</artifactId>
                  <!-- should always be the same version -->
                  <version>${static.analysis.conf.version}</version>
                  <classifier>site</classifier>
                  <type>jar</type>
                  <overWrite>false</overWrite>
                  <outputDirectory>${project.build.directory}/site</outputDirectory>
                  <includes>css/site.css,img/*,js/*</includes>
                </artifactItem>
              </artifactItems>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.bsc.maven</groupId>
        <artifactId>maven-processor-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.ning.maven.plugins</groupId>
        <artifactId>maven-duplicate-finder-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.google.code.sortpom</groupId>
        <artifactId>maven-sortpom-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
</project>
