<?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>
    <groupId>org.codeprimate</groupId>
    <artifactId>cp-core</artifactId>
    <version>1.0.0.RELEASE</version>
    <relativePath>../cp-core/pom.xml</relativePath>
  </parent>
  <artifactId>cp-elements</artifactId>
  <version>1.0.0.M2</version>
  <packaging>jar</packaging>

  <name>cp-elements</name>
  <description>
    'Codeprimate Elements' (a.k.a. cp-elements, or Elements) is a Java class library and micro-framework that simplifies 
    the development of software applications written in Java.  Elements packages several APIs in one library in order to 
    address various application concerns and aspects of software development collectively.  Elememts is a highly simple, 
    yet robust and proven library built on solid OO principles, design patterns and best practices effectively solving 
    common and reoccuring problems in software development. 
  </description>
  <url>http://www.codeprimate.org/products/cp-elements</url>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <comments>
        Copyright 2016-Present Author or Authors.

        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.
      </comments>
    </license>
  </licenses>

  <organization>
    <name>Codeprimate, LLC</name>
    <url>http://www.codeprimate.org/</url>
  </organization>

  <developers>
    <developer>
      <id>jblum</id>
      <name>John J. Blum</name>
      <email>john dot blum at codeprimate dot org</email>
      <organization>Codeprimate, LLC.</organization>
      <organizationUrl>http://www.codeprimate.org</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:codeprimate-software/cp-elements.git</connection>
    <developerConnection>scm:git:git@github.com:codeprimate-software/cp-elements.git</developerConnection>
    <url>https://github.com/codeprimate-software/cp-elements</url>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/codeprimate-software/cp-elements/issues</url>
  </issueManagement>

  <properties>
    <findbugs-maven-plugin.version>3.0.3</findbugs-maven-plugin.version>
    <jacoco-maven-plugin.version>0.7.5.201505241946</jacoco-maven-plugin.version>
    <maven-changelog-plugin.version>2.3</maven-changelog-plugin.version>
    <maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
    <maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
    <maven-jxr-plugin.version>2.1</maven-jxr-plugin.version>
    <maven-pmd-plugin.version>3.6</maven-pmd-plugin.version>
    <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
    <maven-source-plugin.version>2.4</maven-source-plugin.version>
    <maven-surefire-report-plugin.version>2.19.1</maven-surefire-report-plugin.version>
  </properties>

  <profiles>
    <profile>
      <id>code-analysis</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>${jacoco-maven-plugin.version}</version>
            <executions>
              <execution>
                <id>default-prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>custom-report</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>report</goal>
                </goals>
              </execution>
              <execution>
                <id>custom-check</id>
                <goals>
                  <goal>check</goal>
                </goals>
                <configuration>
                  <rules>
                    <!--  implementation is needed only for Maven 2  -->
                    <rule implementation="org.jacoco.maven.RuleConfiguration">
                      <element>BUNDLE</element>
                      <limits>
                        <!--  implementation is needed only for Maven 2  -->
                        <limit implementation="org.jacoco.report.check.Limit">
                          <counter>COMPLEXITY</counter>
                          <value>COVEREDRATIO</value>
                          <minimum>0.60</minimum>
                        </limit>
                      </limits>
                    </rule>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <reporting>
        <plugins>
          <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-jxr-plugin</artifactId>
            <version>${maven-jxr-plugin.version}</version>
            <configuration>
              <javadocDir>${project.build.directory}/apidocs</javadocDir>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <version>${maven-checkstyle-plugin.version}</version>
            <configuration>
              <configLocation>${basedir}/etc/checkstyle/config/codeprimate_checks.xml</configLocation>
              <failsOnError>true</failsOnError>
              <headerLocation>${basedir}/etc/checkstyle/config/java.header</headerLocation>
              <suppressionsLocation>${basedir}/etc/checkstyle/config/suppressions.xml</suppressionsLocation>
              <suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <version>${findbugs-maven-plugin.version}</version>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>${maven-pmd-plugin.version}</version>
            <configuration>
              <rulesets>
                <ruleset>/rulesets/java/basic.xml</ruleset>
                <ruleset>/rulesets/java/braces.xml</ruleset>
                <ruleset>/rulesets/java/clone.xml</ruleset>
                <ruleset>/rulesets/java/codesize.xml</ruleset>
                <ruleset>/rulesets/java/comments.xml</ruleset>
                <ruleset>/rulesets/java/coupling.xml</ruleset>
                <ruleset>/rulesets/java/design.xml</ruleset>
                <ruleset>/rulesets/java/empty.xml</ruleset>
                <ruleset>/rulesets/java/finalizers.xml</ruleset>
                <ruleset>/rulesets/java/imports.xml</ruleset>
                <ruleset>/rulesets/java/javabeans.xml</ruleset>
                <ruleset>/rulesets/java/junit.xml</ruleset>
                <ruleset>/rulesets/java/naming.xml</ruleset>
                <ruleset>/rulesets/java/optimizations.xml</ruleset>
                <ruleset>/rulesets/java/strictexception.xml</ruleset>
                <ruleset>/rulesets/java/strings.xml</ruleset>
                <ruleset>/rulesets/java/sunsecure.xml</ruleset>
                <ruleset>/rulesets/java/typeresolution.xml</ruleset>
                <ruleset>/rulesets/java/unnecessary.xml</ruleset>
                <ruleset>/rulesets/java/unusedcode.xml</ruleset>
              </rulesets>
            </configuration>
          </plugin>
        </plugins>
      </reporting>
    </profile>
    <profile>
      <id>prepare-release</id>
      <properties>
        <skipTests>false</skipTests>
      </properties>
      <reporting>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-changelog-plugin</artifactId>
            <version>${maven-changelog-plugin.version}</version>
            <reportSets>
              <reportSet>
                <id>all-reports</id>
                <configuration>
                  <type>date</type>
                  <dates>
                    <date implementation="java.lang.String">2016-01-06</date>
                    <date implementation="java.lang.String">2016-09-06</date>
                  </dates>
                  <dateFormat>yyyy-MM-dd</dateFormat>
                </configuration>
                <reports>
                  <report>changelog</report>
                  <report>dev-activity</report>
                  <report>file-activity</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
        </plugins>
      </reporting>
    </profile>
    <profile>
      <id>auto-release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>${maven-release-plugin.version}</version>
            <configuration>
              <autoVersionSubmodules>true</autoVersionSubmodules>
              <useReleaseProfile>false</useReleaseProfile>
              <releaseProfiles>release</releaseProfiles>
              <goals>deploy</goals>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <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-no-fork</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>
          <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>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <snapshotRepository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
      </distributionManagement>
    </profile>
  </profiles>

</project>
