<?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.github.squirrelgrip</groupId>
    <artifactId>extensions</artifactId>
    <version>1.0.6</version>
    <packaging>jar</packaging>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>A collection of useful kotlin extensions</description>
    <url>https://github.com/SquirrelGrip/extension</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Adrian Richter</name>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/SquirrelGrip/extension.git</connection>
        <developerConnection>scm:git:https://github.com/SquirrelGrip/extension.git</developerConnection>
        <url>${project.url}</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <kotlin.code.style>official</kotlin.code.style>

        <dokka.version>0.10.1</dokka.version>
        <jackson.version>2.10.3</jackson.version>
        <junit-jupiter.version>5.6.1</junit-jupiter.version>
        <kotlin.version>1.3.71</kotlin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
            <version>${kotlin.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-kotlin</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit-jupiter.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <distributionManagement>
        <snapshotRepository>
            <id>oss-snapshot</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>oss-release</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
    </distributionManagement>

    <pluginRepositories>
        <pluginRepository>
            <id>jcenter</id>
            <url>https://jcenter.bintray.com/</url>
        </pluginRepository>
        <pluginRepository>
            <id>oss-release</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <sourceDirectory>src/main/kotlin</sourceDirectory>
        <testSourceDirectory>src/test/kotlin</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin.version}</version>
                <configuration>
                    <args>
                        <arg>-Xjsr305=strict</arg>
                    </args>
                    <compilerPlugins>
                        <plugin>spring</plugin>
                    </compilerPlugins>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.jetbrains.kotlin</groupId>
                        <artifactId>kotlin-maven-allopen</artifactId>
                        <version>${kotlin.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.5</version>
                <configuration>
                    <executable>gpg</executable>
                    <keyname>${env.GPG_KEYNAME}</keyname>
                    <passphrase>${env.GPG_PASSPHRASE}</passphrase>
                </configuration>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</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>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <processPlugins>false</processPlugins>
                    <processDependencies>false</processDependencies>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.manamind.jgitflow</groupId>
                <artifactId>jgitflow-maven-plugin</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <username>${env.GIT_USER}</username>
                    <password>${env.GIT_TOKEN}</password>
                    <pullMaster>true</pullMaster>
                    <pullDevelop>true</pullDevelop>
                    <pushReleases>true</pushReleases>
                    <pushHotfixes>true</pushHotfixes>
                    <scmCommentPrefix>(CI):</scmCommentPrefix>
                    <useReleaseProfile>false</useReleaseProfile>
                    <allowUntracked>true</allowUntracked>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <version>1.11.2</version>
                <configuration>
                    <providerImplementations>
                        <git>jgit</git>
                    </providerImplementations>
                    <username>${env.GIT_USER}</username>
                    <password>${env.GIT_TOKEN}</password>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-jgit</artifactId>
                        <version>1.11.2</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.0.0-M1</version>
                <configuration>
                    <deployAtEnd>true</deployAtEnd>
                    <retryFailedDeploymentCount>3</retryFailedDeploymentCount>
                </configuration>
            </plugin>
            <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>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jetbrains.dokka</groupId>
                <artifactId>dokka-maven-plugin</artifactId>
                <version>${dokka.version}</version>
                <executions>
                    <execution>
                        <id>javadocJar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>javadocJar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <jdkVersion>8</jdkVersion>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <properties>
                <deployment.url>${project.distributionManagement.repository.url}</deployment.url>
            </properties>
        </profile>
        <profile>
            <id>gitflowStart</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.manamind.jgitflow</groupId>
                        <artifactId>jgitflow-maven-plugin</artifactId>
                        <version>1.0.0</version>
                        <configuration combine.self="append">
                            <allowSnapshots>true</allowSnapshots>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>gitflowFinish</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.manamind.jgitflow</groupId>
                        <artifactId>jgitflow-maven-plugin</artifactId>
                        <version>1.0.0</version>
                        <configuration combine.self="append">
                            <allowSnapshots>false</allowSnapshots>
                            <goals>clean deploy -Prelease</goals>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
