<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2015-2016 HandcraftedBits

  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:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>com.handcraftedbits</groupId>
  <artifactId>handcraftedbits-codequality</artifactId>
  <packaging>jar</packaging>
  <name>HandcraftedBits Code Quality Settings</name>
  <description>A collection of code quality settings for HandcraftedBits projects</description>
  <url>https://github.com/handcraftedbits/handcraftedbits-codequality</url>
  <version>1.0.7</version>
  <inceptionYear>2015</inceptionYear>

  <developers>
    <developer>
      <name>Curtiss Howard</name>
      <email>opensource@handcraftedbits.com</email>
      <organization>HandcraftedBits</organization>
      <organizationUrl>https://github.com/handcraftedbits</organizationUrl>
    </developer>
  </developers>
  <organization>
    <name>HandcraftedBits</name>
    <url>https://github.com/handcraftedbits</url>
  </organization>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
    </license>
  </licenses>

  <scm>
    <url>https://github.com/handcraftedbits/handcraftedbits-codequality</url>
    <connection>scm:git:git://github.com/handcraftedbits/handcraftedbits-codequality.git</connection>
    <developerConnection>
      scm:git:git@github.com:handcraftedbits/handcraftedbits-codequality.git
    </developerConnection>
  </scm>
  <issueManagement>
    <url>https://github.com/handcraftedbits/handcraftedbits-codequality/issues</url>
    <system>GitHub Issues</system>
  </issueManagement>
  
  <properties>
    <javadoc.excludedPackages></javadoc.excludedPackages>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <version.java>1.8</version.java>
    
    <version.plugin.compiler>3.7.0</version.plugin.compiler>
    <version.plugin.gpg>1.6</version.plugin.gpg>
    <version.plugin.javadoc>3.0.0</version.plugin.javadoc>
    <version.plugin.nexus-staging>1.6.8</version.plugin.nexus-staging>
    <version.plugin.source>3.0.1</version.plugin.source>
  </properties>
  
  <build>
    <pluginManagement>
      <plugins>
        <!-- This is only here to keep Eclipse from complaining about the Java version for this project. -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${version.plugin.compiler}</version>
          <configuration>
            <source>${version.java}</source>
            <target>${version.java}</target>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  
  <profiles>
    <!-- Release/deploy to Maven Central -->
    <profile>
      <id>release</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${version.plugin.gpg}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${version.plugin.javadoc}</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <additionalparam>-Xdoclint:none</additionalparam>
                  <excludePackageNames>${javadoc.excludedPackages}</excludePackageNames>
                  <links>
                    <link>https://docs.oracle.com/javaee/7/api/</link>
                  </links>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${version.plugin.source}</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>${version.plugin.nexus-staging}</version>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</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>
