<?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>
    <prerequisites>
        <maven>3.0.4</maven>
    </prerequisites>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <name>Snice Commons</name>
    <groupId>io.snice</groupId>
    <artifactId>snice-commons-parent</artifactId>
    <version>0.1.13</version>
    <packaging>pom</packaging>
    <description>Snice Commons - Because even Super Nice things have things in Common</description>
    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Jonas Borjesson</name>
            <email>jonas@jonasborjesson.com</email>
            <timezone>-8</timezone>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:sniceio/snice-commons.git</connection>
        <developerConnection>scm:git:https://github.com/sniceio/snice-commons.git</developerConnection>
        <url>https://github.com:sniceio/snice-commons</url>
        <tag>snice-commons-release-0.1.13</tag>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <slf4j.version>2.0.5</slf4j.version>
        <logback.version>1.4.5</logback.version>
        <jackson.version>2.14.1</jackson.version>
        <logstash.version>7.2</logstash.version>
    </properties>

    <modules>
        <module>snice-commons</module>
        <module>snice-logging</module>
        <module>snice-buffers</module>
    </modules>

    <distributionManagement>
      <repository>
        <id>ossrh</id>
        <name>Nexus Release Repository</name>
        <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
      </repository>
      <snapshotRepository>
        <id>ossrh</id>
        <name>Sonatype Nexus Snapshots</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
      </snapshotRepository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>io.snice</groupId>
                <artifactId>snice-commons</artifactId>
                <version>${project.version}</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>

            <dependency>
                <groupId>io.snice</groupId>
                <artifactId>snice-buffers</artifactId>
                <version>${project.version}</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>

            <dependency>
                <groupId>io.snice</groupId>
                <artifactId>snice-logging</artifactId>
                <version>${project.version}</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>

            <!-- Test Dependencies -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.1</version>
                <type>jar</type>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-all</artifactId>
                <version>1.8.5</version>
                <type>jar</type>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>net.logstash.logback</groupId>
                <artifactId>logstash-logback-encoder</artifactId>
                <version>${logstash.version}</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</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>
                        <version>1.6.13</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                            <stagingProgressTimeoutMinutes>10</stagingProgressTimeoutMinutes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <tagNameFormat>snice-commons-release-@{project.version}</tagNameFormat>
                </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>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <additionalparam>-Xdoclint:none</additionalparam>
                    <additionalJOption>-Xdoclint:none</additionalJOption>
                    <!-- See for why source 8: https://bugs.openjdk.java.net/browse/JDK-8212233 -->
                    <source>11</source>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
