<?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.hubject</groupId>
    <artifactId>aws-s3-io</artifactId>
    <version>1.0.1</version>

    <properties>
        <kotlin.version>1.2.10</kotlin.version>
        <awssdk.version>1.11.355</awssdk.version>
        <kotlintest.version>3.1.7</kotlintest.version>
    </properties>

    <name>aws-s3-io</name>
    <description>Additional I/O classes for AWS S3</description>
    <url>https://github.com/hubject/aws-s3-io</url>
    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://choosealicense.com/licenses/mit/</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Tobias Marstaller</name>
            <email>tobias.marstaller@hubject.com</email>
            <organization>Hubject GmbH</organization>
            <organizationUrl>https://www.hubject.com</organizationUrl>
            <timezone>Europe/Berlin</timezone>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/hubject/aws-s3-io</url>
        <connection>scm:git:git@github.com:hubject/aws-s3-io.git</connection>
        <developerConnection>scm:git:git@github.com:hubject/aws-s3-io.git</developerConnection>
    </scm>

    <distributionManagement>
        <repository>
            <id>sonatype-releases</id>
            <name>Sonatype Releases</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <snapshotRepository>
            <id>sonatype-snapshots</id>
            <name>Sonatype Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencies>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
            <version>${kotlin.version}</version>
        </dependency>

        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-s3</artifactId>
            <version>${awssdk.version}</version>
        </dependency>

        <dependency>
            <groupId>io.kotlintest</groupId>
            <artifactId>kotlintest-runner-junit5</artifactId>
            <version>${kotlintest.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.mockk</groupId>
            <artifactId>mockk</artifactId>
            <version>1.8.5</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <pluginRepositories>
        <pluginRepository>
            <id>jcenter</id>
            <name>JCenter</name>
            <url>https://jcenter.bintray.com/</url>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
        <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>

        <plugins>
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin.version}</version>

                <executions>
                    <execution>
                        <id>compile</id>
                        <goals> <goal>compile</goal> </goals>
                    </execution>

                    <execution>
                        <id>test-compile</id>
                        <goals> <goal>test-compile</goal> </goals>
                    </execution>

                </executions>

                <configuration>
                    <jvmTarget>1.8</jvmTarget>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <executions>
                    <!-- Replacing default-compile as it is treated specially by maven -->
                    <execution>
                        <id>default-compile</id>
                        <phase>none</phase>
                    </execution>
                    <!-- Replacing default-testCompile as it is treated specially by maven -->
                    <execution>
                        <id>default-testCompile</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>java-compile</id>
                        <phase>compile</phase>
                        <goals> <goal>compile</goal> </goals>
                    </execution>
                    <execution>
                        <id>java-test-compile</id>
                        <phase>test-compile</phase>
                        <goals> <goal>testCompile</goal> </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.0</version>
            </plugin>

            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jetbrains.dokka</groupId>
                <artifactId>dokka-maven-plugin</artifactId>
                <version>0.9.17</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>javadocJar</goal>
                        </goals>
                        <configuration>
                            <impliedPlatforms>
                                <platform>JVM</platform>
                            </impliedPlatforms>
                            <includes>
                                <file>${project.basedir}/README.md</file>
                            </includes>
                            <jdkVersion>8</jdkVersion>
                            <sourceLinks>
                                <link>
                                    <dir>${project.basedir}/src/main/kotlin</dir>
                                    <url>https://github.com/hubject/aws-s3-io</url>
                                    <urlSuffix>#L</urlSuffix>
                                </link>
                            </sourceLinks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <tagNameFormat>v{project.version}</tagNameFormat>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>deploy</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
