<?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>
  <groupId>info.freelibrary</groupId>
  <artifactId>freelib-utils</artifactId>
  <packaging>maven-plugin</packaging>
  <version>0.4.6</version>
  <name>FreeLibrary Utilities</name>
  <description>A small collection of utility classes used by other FreeLibrary projects</description>
  <url>http://projects.freelibrary.info/freelib-utils</url>
  <licenses>
    <license>
      <name>GNU Lesser General Public License, Version 3.0</name>
      <url>http://www.gnu.org/licenses/lgpl-3.0.html</url>
      <comments>Licensed under the GNU LGPL 3.0 or later (at your option)</comments>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git@github.com:ksclarke/freelib-utils.git</connection>
    <developerConnection>scm:git:git@github.com:ksclarke/freelib-utils.git</developerConnection>
    <url>git@github.com:ksclarke/freelib-utils.git</url>
  </scm>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/ksclarke/freelib-utils/issues</url>
  </issueManagement>
  <organization>
    <name>FreeLibrary</name>
    <url>http://freelibrary.info</url>
  </organization>
  <developers>
    <developer>
      <email>ksclarke@gmail.com</email>
      <name>Kevin S. Clarke</name>
      <url>http://kevinclarke.info</url>
      <roles>
        <role>developer</role>
      </roles>
      <timezone>America/New_York</timezone>
    </developer>
  </developers>
  <properties>
    <freelib.build.tools.version>0.0.6</freelib.build.tools.version>
    <iharder.base64.version>2.3.8</iharder.base64.version>
    <commons.compress.version>1.5</commons.compress.version>
    <slf4j.version>1.7.5</slf4j.version>
    <logback.version>1.0.13</logback.version>
    <junit.version>4.11</junit.version>
    <xom.version>1.2.5</xom.version>
    <xmlunit.version>1.5</xmlunit.version>
    <maven.checkstyle.version>2.11</maven.checkstyle.version>

    <!-- used for finding the unpacked checkstyle-suppressions.xml file -->
    <!-- built-in for eclipse-cs tool so we make it work with maven too -->
    <config_loc>${project.basedir}/target/classes/checkstyle</config_loc>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>
  <dependencies>
    <dependency>
      <groupId>net.iharder</groupId>
      <artifactId>base64</artifactId>
      <version>${iharder.base64.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-compress</artifactId>
      <version>${commons.compress.version}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
    <!-- below dependencies are only used for testing -->
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>${logback.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>xom</groupId>
      <artifactId>xom</artifactId>
      <version>${xom.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>xmlunit</groupId>
      <artifactId>xmlunit</artifactId>
      <version>${xmlunit.version}</version>
      <scope>test</scope>
    </dependency>
    <!-- Below here are the dependencies for our Maven mojos -->
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>3.2.1</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>3.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>3.2.1</version>
    </dependency>
  </dependencies>
  <build>
    <resources>
      <!-- site's markdown template resources -->
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>**/*.md</include>
        </includes>
        <targetPath>${basedir}/src</targetPath>
      </resource>
      <!-- normal types of project resources -->
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <filtering>true</filtering>
        <excludes>
          <exclude>**/*.md</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
      <!-- below needed because http://jira.codehaus.org/browse/MNG-5346 -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.2</version>
        <executions>
          <execution>
            <id>default-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
            <phase>process-classes</phase>
          </execution>
          <execution>
            <id>help-descriptor</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
            <phase>process-classes</phase>
          </execution>
        </executions>
      </plugin>
      <!-- checks project's code for conformance to coding standards -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${maven.checkstyle.version}</version>
        <dependencies>
          <!-- add the newer checkstyle with throwsIndent support -->
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>5.7</version>
          </dependency>
        </dependencies>
        <configuration>
          <consoleOutput>true</consoleOutput>
          <violationSeverity>warning</violationSeverity>
          <configLocation>${basedir}/target/classes/checkstyle/checkstyle.xml</configLocation>
        </configuration>
        <executions>
          <execution>
            <id>checkstyle</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- enforces some rules for the project, like checkstyle does for code -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.3.1</version>
        <executions>
          <execution>
            <id>enforce-no-snapshots</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <failFast>true</failFast>
              <rules>
                <!-- don't want to allow snapshots unless excluded -->
                <!-- can be skipped by adding following to command line: -Denforcer.skip=true -->
                <requireReleaseDeps>
                  <message>Sorry, no dependency snapshots allowed! Skip this check by adding the following to the
                    command line: -Denforcer.skip=true</message>
                </requireReleaseDeps>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- extracts project site's css and js from freelib-build-tools jar -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.8</version>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <!-- copies the site stylesheets into the project -->
                <artifactItem>
                  <groupId>info.freelibrary</groupId>
                  <artifactId>freelib-build-tools</artifactId>
                  <version>${freelib.build.tools.version}</version>
                  <type>jar</type>
                  <includes>**/*.css,**/*.js</includes>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                </artifactItem>
                <!-- copies site templates into the resources directory -->
                <artifactItem>
                  <groupId>info.freelibrary</groupId>
                  <artifactId>freelib-build-tools</artifactId>
                  <version>${freelib.build.tools.version}</version>
                  <type>jar</type>
                  <includes>**/*.md</includes>
                  <outputDirectory>${basedir}/src/main/resources</outputDirectory>
                </artifactItem>
                <!-- copies checkstyle configs so we can filter them -->
                <artifactItem>
                  <groupId>info.freelibrary</groupId>
                  <artifactId>freelib-build-tools</artifactId>
                  <version>${freelib.build.tools.version}</version>
                  <type>jar</type>
                  <includes>checkstyle/*.xml</includes>
                  <outputDirectory>${basedir}/src/main/resources</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.5.1</version>
        <configuration>
          <!-- need to specify this for the m2e plugin -->
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
      <!-- cleans up build artifacts -->
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <filesets>
            <fileset>
              <directory>${basedir}/src</directory>
              <includes>
                <include>**/coders-welcome.md</include>
                <include>**/testers-welcome.md</include>
                <include>**/translators-welcome.md</include>
                <include>**/documenters-welcome.md</include>
              </includes>
            </fileset>
            <fileset>
              <directory>${basedir}/src/main/resources/checkstyle</directory>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <!-- maven site generates documentation for use in project website -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <generateReports>true</generateReports>
          <inputEncoding>${project.build.sourceEncoding}</inputEncoding>
          <outputEncoding>${project.build.sourceEncoding}</outputEncoding>
          <reportPlugins>
            <!-- includes information about project's dependencies -->
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>jdepend-maven-plugin</artifactId>
            </plugin>
            <!-- includes the standard maven project reports -->
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-project-info-reports-plugin</artifactId>
              <version>2.6</version>
              <configuration>
                <anonymousConnection>scm:git:git@github.com:ksclarke/freelib-utils.git</anonymousConnection>
                <developerConnection>scm:git:git@github.com:ksclarke/freelib-utils.git</developerConnection>
              </configuration>
              <reportSets>
                <reportSet>
                  <reports>
                    <report>summary</report>
                    <report>license</report>
                    <report>modules</report>
                    <report>project-team</report>
                    <report>plugins</report>
                    <report>dependency-info</report>
                  </reports>
                </reportSet>
              </reportSets>
            </plugin>
            <!-- includes unit test reports -->
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <version>2.16</version>
              <configuration>
                <forkCount>3</forkCount>
                <reuseForks>true</reuseForks>
              </configuration>
            </plugin>
            <!-- includes report of changes from the Git repo -->
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-changes-plugin</artifactId>
              <version>2.9</version>
              <reportSets>
                <reportSet>
                  <reports>
                    <report>changes-report</report>
                  </reports>
                </reportSet>
              </reportSets>
            </plugin>
            <!-- includes a changelog built from Git repo activity -->
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-changelog-plugin</artifactId>
              <version>2.2</version>
            </plugin>
            <!-- includes javadoc documentation of the project's code -->
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <version>2.9</version>
              <reportSets>
                <reportSet>
                  <id>default</id>
                  <reports>
                    <report>javadoc</report>
                  </reports>
                </reportSet>
                <reportSet>
                  <id>aggregate</id>
                  <reports>
                    <report>aggregate</report>
                  </reports>
                </reportSet>
              </reportSets>
            </plugin>
            <!-- findbugs finds common programming problems -->
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>findbugs-maven-plugin</artifactId>
              <version>2.5.2</version>
            </plugin>
            <!-- checkstyle here generates the plugin's reports -->
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-checkstyle-plugin</artifactId>
              <version>${maven.checkstyle.version}</version>
              <configuration>
                <consoleOutput>true</consoleOutput>
                <configLocation>${basedir}/target/classes/checkstyle/checkstyle.xml</configLocation>
              </configuration>
            </plugin>
            <!-- source code analyzer somewhat similar to findbugs -->
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-pmd-plugin</artifactId>
              <version>3.0.1</version>
              <configuration>
                <aggregate>true</aggregate>
                <sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
                <minimumTokens>100</minimumTokens>
                <verbose>true</verbose>
                <targetJdk>1.7</targetJdk>
              </configuration>
            </plugin>
            <!-- report of code tags like TODO, FIXME, etc. -->
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>taglist-maven-plugin</artifactId>
              <version>2.4</version>
              <configuration>
                <tagListOptions>
                  <tagClasses>
                    <tagClass>
                      <displayName>TODOs</displayName>
                      <tags>
                        <tag>
                          <matchString>TODO</matchString>
                          <matchType>exact</matchType>
                        </tag>
                      </tags>
                    </tagClass>
                    <tagClass>
                      <displayName>FIXMEs</displayName>
                      <tags>
                        <tag>
                          <matchString>FIXME</matchString>
                          <matchType>exact</matchType>
                        </tag>
                      </tags>
                    </tagClass>
                  </tagClasses>
                </tagListOptions>
              </configuration>
            </plugin>
            <!-- calculates test coverage of the project's code -->
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>cobertura-maven-plugin</artifactId>
              <version>2.5.2</version>
              <configuration>
                <aggregate>true</aggregate>
                <outputDirectory>${project.reporting.outputDirectory}/cobertura</outputDirectory>
              </configuration>
            </plugin>
          </reportPlugins>
        </configuration>
        <dependencies>
          <!-- these three deps are used to generate the Maven site -->
          <dependency>
            <groupId>org.apache.maven.doxia</groupId>
            <artifactId>doxia-module-markdown</artifactId>
            <version>1.3</version>
          </dependency>
          <dependency>
            <groupId>lt.velykis.maven.skins</groupId>
            <artifactId>reflow-velocity-tools</artifactId>
            <version>1.0.0</version>
          </dependency>
          <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
            <version>1.7</version>
          </dependency>
        </dependencies>
      </plugin>
      <!-- this runs the unit tests on compile (not site generation) -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.16</version>
        <configuration>
          <argLine>-XX:-UseSplitVerifier</argLine>
        </configuration>
      </plugin>
    </plugins>
    <extensions>
      <!-- the static project site is published to an S3 bucket for viewing -->
      <extension>
        <groupId>org.kuali.maven.wagons</groupId>
        <artifactId>maven-s3-wagon</artifactId>
        <version>1.1.20</version>
      </extension>
    </extensions>
  </build>
  <!-- the profile configured here allows publishing the project's artifact -->
  <profiles>
    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <!-- enables pushing the project documentation up to an S3 bucket -->
  <distributionManagement>
    <site>
      <id>s3.site</id>
      <url>s3://projects.freelibrary.info/freelib-utils</url>
    </site>
  </distributionManagement>
  <!-- the project is deployed to the central maven repo through Sonatype -->
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>
</project>
