<?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>com.arcticicestudio</groupId>
  <artifactId>icecore-hashids</artifactId>
  <version>0.4.0</version>
  <packaging>jar</packaging>

  <name>icecore-hashids</name>
  <description>A lightweight generator for short, unique, non-sequential and decodable Hashids from non-negative numbers.</description>
  <url>https://github.com/arcticicestudio/icecore-hashids</url>
  <inceptionYear>2016</inceptionYear>
  <organization>
    <name>Arctic Ice Studio</name>
    <url>http://arcticicestudio.com</url>
  </organization>

  <developers>
    <developer>
      <id>arcticicestudio</id>
      <name>Arctic Ice Studio</name>
      <email>development@arcticicestudio.com</email>
      <url>http://arcticicestudio.com</url>
      <organization>Arctic Ice Studio</organization>
      <organizationUrl>http://arcticicestudio.com</organizationUrl>
      <roles>
        <role>project-owner</role>
        <role>developer</role>
      </roles>
      <properties>
        <github>https://github.com/arcticicestudio</github>
        <twitter>https://twitter.com/arcticicestudio</twitter>
        <reddit>https://reddit.com/user/arcticicestudio</reddit>
      </properties>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <contributors>
    <contributor>
      <name>Arctic Ice Studio</name>
      <email>development@arcticicestudio.com</email>
      <url>http://arcticicestudio.com</url>
      <organization>Arctic Ice Studio</organization>
      <organizationUrl>http://arcticicestudio.com</organizationUrl>
      <roles>
        <role>project-owner</role>
        <role>developer</role>
      </roles>
      <properties>
        <github>https://github.com/arcticicestudio</github>
        <twitter>https://twitter.com/arcticicestudio</twitter>
        <reddit>https://reddit.com/user/arcticicestudio</reddit>
      </properties>
    </contributor>
  </contributors>

  <properties>
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.version.min>3.0.4</maven.version.min>
    <checkstyle.version>8.0</checkstyle.version>
    <junit.version>4.12</junit.version>
    <hamcrest.version>2.0.0.0</hamcrest.version>
    <node.version>v8.2.1</node.version>
  </properties>

  <scm>
    <connection>scm:git:https://github.com/arcticicestudio/icecore-hashids.git</connection>
    <developerConnection>scm:git:git://git@github.com:arcticicestudio/icecore-hashids.git</developerConnection>
    <tag>HEAD</tag>
    <url>https://github.com/arcticicestudio/icecore-hashids</url>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/arcticicestudio/icecore-hashids/issues</url>
  </issueManagement>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-junit</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <finalName>${project.artifactId}-${project.version}</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.6.1</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.2</version>
        <configuration>
          <archive>
            <addMavenDescriptor>false</addMavenDescriptor>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <packageName>${project.groupId}</packageName>
            </manifest>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>package</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <classifier>sources</classifier>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <packageName>${project.groupId}</packageName>
            </manifest>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.0.0-M1</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <classifier>javadoc</classifier>
          <encoding>${project.build.sourceEncoding}</encoding>
          <author>true</author>
          <bottom>Copyright &#169; 2017 {organizationName}</bottom>
          <doctitle>${project.name} ${project.version} API</doctitle>
          <windowtitle>${project.name} ${project.version} API</windowtitle>
          <tags>
            <tag>
              <name>apiNote</name>
              <placement>a</placement>
              <head>API Note:</head>
            </tag>
            <tag>
              <name>implSpec</name>
              <placement>a</placement>
              <head>Implementation Specification:</head>
            </tag>
            <tag>
              <name>implNote</name>
              <placement>a</placement>
              <head>Implementation Note:</head>
            </tag>
          </tags>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.17</version>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>${checkstyle.version}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <configuration>
              <configLocation>${basedir}/src/main/resources/arcticicestudio-styleguide-java-checkstyle.xml</configLocation>
              <encoding>UTF-8</encoding>
              <consoleOutput>true</consoleOutput>
              <failsOnError>true</failsOnError>
            </configuration>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.4.1</version>
        <executions>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>(${maven.version.min},)</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>${java.version}</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <repositories>
    <repository>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>true</enabled>
        <checksumPolicy>warn</checksumPolicy>
      </snapshots>
      <releases>
        <enabled>true</enabled>
        <checksumPolicy>fail</checksumPolicy>
      </releases>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>true</enabled>
        <checksumPolicy>warn</checksumPolicy>
      </snapshots>
      <releases>
        <enabled>true</enabled>
        <checksumPolicy>fail</checksumPolicy>
      </releases>
    </pluginRepository>
  </pluginRepositories>

  <profiles>
    <profile>
      <id>node</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-clean-plugin</artifactId>
            <configuration>
              <filesets>
                <fileset>
                  <directory>node_modules</directory>
                </fileset>
              </filesets>
            </configuration>
          </plugin>

          <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <version>1.5</version>
            <executions>
              <execution>
                <id>install-node-and-npm</id>
                <goals>
                  <goal>install-node-and-npm</goal>
                </goals>
                <configuration>
                  <nodeVersion>${node.version}</nodeVersion>
                  <installDirectory>${project.build.directory}</installDirectory>
                </configuration>
              </execution>
              <execution>
                <id>npm install</id>
                <goals>
                  <goal>npm</goal>
                </goals>
                <phase>generate-resources</phase>
                <configuration>
                  <installDirectory>${project.build.directory}</installDirectory>
                  <arguments>install</arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>code-coverage</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.7.9</version>
            <executions>
              <execution>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>coverage-report</id>
                <phase>test</phase>
                <goals>
                  <goal>report</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>jfrog</id>
      <distributionManagement>
        <downloadUrl>https://github.com/arcticicestudio/icecore-hashids</downloadUrl>
        <snapshotRepository>
          <id>bintray</id>
          <name>OSS JFrog</name>
          <url>http://oss.jfrog.org/artifactory/oss-snapshot-local</url>
        </snapshotRepository>
        <repository>
          <id>bintray</id>
          <name>JFrog Bintray</name>
          <url>https://api.bintray.com/maven/arcticicestudio/IceCore/icecore-hashids/;publish=1</url>
        </repository>
      </distributionManagement>
    </profile>

    <profile>
      <id>oss-sonatype</id>
      <distributionManagement>
        <downloadUrl>https://github.com/arcticicestudio/icecore-hashids</downloadUrl>
        <snapshotRepository>
          <id>ossrh</id>
          <name>OSS Sonatype</name>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
          <layout>default</layout>
        </snapshotRepository>
        <repository>
          <id>ossrh</id>
          <name>OSS Sonatype</name>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
          <layout>default</layout>
        </repository>
      </distributionManagement>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org</nexusUrl>
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>sign-gpg</id>
      <activation>
        <property>
          <name>gpg.keyname</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <ascDirectory>.</ascDirectory>
              <keyname>${gpg.keyname}</keyname>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
