<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.github.squirrelgrip</groupId>
    <artifactId>Scientist4K</artifactId>
    <version>0.3.3</version>
    <packaging>pom</packaging>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>A Kotlin port of Github's Scientist library for refactoring critical code paths</description>
    <url>https://www.github.com/squirrelgrip/Scientist4K</url>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <dokka.version>0.10.1</dokka.version>
    </properties>

    <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>
        <plugins>
            <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>
                </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>
                <configuration>
                    <jdkVersion>8</jdkVersion>
                </configuration>
            </plugin>
        </plugins>
    </build>

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

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

    <scm>
        <connection>scm:git:https://github.com/SquirrelGrip/Scientist4K.git</connection>
        <developerConnection>scm:git:https://github.com/SquirrelGrip/Scientist4K.git</developerConnection>
        <url>https://github.com/SquirrelGrip/Scientist4K</url>
    </scm>

    <modules>
        <module>Scientist4KCore</module>
    </modules>

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