<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2018 Johannes Donath <johannesd@torchmind.com>
  ~ and other copyright owners as documented in the project's IP log.
  ~
  ~ 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="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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <!-- Artifact Information -->
  <groupId>org.basinmc</groupId>
  <artifactId>lavatory</artifactId>
  <version>1.0</version>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <!-- Artifact Metadata -->
  <name>Lavatory</name>
  <description>A launcher manifest parsing library.</description>
  <url>https://github.com/BasinMC/Lavatory</url>
  <inceptionYear>2018</inceptionYear>

  <organization>
    <name>Basin</name>
    <url>https://www.basinmc.org</url>
  </organization>

  <developers>
    <developer>
      <name>Johannes Donath</name>
      <email>johannesd@torchmind.com</email>
      <url>https://www.johannes-donath.com</url>

      <organization>Basin</organization>
      <organizationUrl>https://www.basinmc.org</organizationUrl>
    </developer>
  </developers>

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

  <scm>
    <url>https://github.com/BasinMC/Lavatory</url>
    <connection>https://github.com/BasinMC/Lavatory.git</connection>
    <developerConnection>git@github.com:BasinMC/Lavatory.git</developerConnection>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/BasinMC/Lavatory/issues</url>
  </issueManagement>

  <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>

  <!-- Dependencies -->
  <dependencies>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
      <version>2.9.4</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.9.4</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jsr310</artifactId>
      <version>2.9.4</version>
    </dependency>
    <dependency>
      <groupId>com.github.spotbugs</groupId>
      <artifactId>spotbugs-annotations</artifactId>
      <version>3.1.1</version>
      <scope>provided</scope>

      <exclusions>
        <exclusion>
          <groupId>com.google.code.findbugs</groupId>
          <artifactId>jsr305</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>2.15.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <!-- Build Settings -->
  <build>
    <finalName>${project.groupId}.${project.artifactId}-${project.version}</finalName>
    <defaultGoal>clean install</defaultGoal>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.0.0</version>

        <configuration>
          <configLocation>google_checks.xml</configLocation>
          <encoding>UTF-8</encoding>
          <consoleOutput>true</consoleOutput>
          <failsOnError>true</failsOnError>

          <excludes>**/module-info.java</excludes>
        </configuration>

        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>

            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.7.0</version>

        <configuration>
          <jdkToolchain>
            <version>9</version>
          </jdkToolchain>

          <release>8</release>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>

        <executions>
          <execution>
            <id>default-compile</id>
            <configuration>
              <release>9</release>
              <source>9</source>
              <target>9</target>
            </configuration>
          </execution>
          <execution>
            <id>base-compile</id>

            <goals>
              <goal>compile</goal>
            </goals>

            <configuration>
              <excludes>
                <exclude>module-info.java</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.0.0</version>

        <executions>
          <execution>
            <id>attach-javadocs</id>

            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>

        <executions>
          <execution>
            <id>attach-sources</id>

            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>deployment</id>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>

            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>

                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
