<?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>org.taymyr</groupId>
  <artifactId>lagom-extensions</artifactId>
  <version>0.0.2</version>
  <packaging>jar</packaging>
  <name>Lagom Extensions</name>
  <description>Utilities for Lagom framework</description>
  <url>https://taymyr.org</url>
  <organization>
    <name>Digital Economy League</name>
    <url>https://www.digitalleague.ru/</url>
  </organization>
  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>taymyr</id>
      <name>Taymyr Contributors</name>
      <url>https://github.com/taymyr</url>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:https://github.com/taymyr/lagom-extensions.git</connection>
    <developerConnection>scm:git:https://github.com/taymyr/lagom-extensions.git</developerConnection>
    <url>https://github.com/taymyr/lagom-extensions</url>
    <tag>HEAD</tag>
  </scm>
  <properties>
    <dokka.version>0.9.17</dokka.version>
    <kotlin.version>1.2.61</kotlin.version>
    <lagom.version>[1.4.0,)</lagom.version>
    <junit5.version>5.3.1</junit5.version>
    <assertj.version>3.11.1</assertj.version>
    <ktlint.version>0.28.0</ktlint.version>
    <deploy.plugin.version>2.8.2</deploy.plugin.version>
    <antrun.plugin.version>1.8</antrun.plugin.version>
    <source.plugin.version>3.0.1</source.plugin.version>
    <jar.plugin.version>3.1.0</jar.plugin.version>
    <surefire.plugin.version>2.22.0</surefire.plugin.version>
    <jacoco.plugin.version>0.8.2</jacoco.plugin.version>
    <kotlin.compiler.incremental>true</kotlin.compiler.incremental>
    <kotlin.compiler.languageVersion>1.2</kotlin.compiler.languageVersion>
    <kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib-jdk8</artifactId>
      <version>${kotlin.version}</version>
    </dependency>
    <!-- provided dependencies -->
    <dependency>
      <groupId>com.lightbend.lagom</groupId>
      <artifactId>lagom-javadsl-api_2.12</artifactId>
      <version>${lagom.version}</version>
      <scope>provided</scope>
    </dependency>
    <!-- test dependencies -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>${junit5.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${assertj.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
    <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>${deploy.plugin.version}</version>
        <executions>
          <execution>
            <id>default-deploy</id>
            <phase>deploy</phase>
            <goals><goal>deploy</goal></goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-maven-plugin</artifactId>
        <version>${kotlin.version}</version>
        <configuration>
          <args>
            <arg>-Xjsr305=strict</arg>
          </args>
        </configuration>
        <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.jetbrains.dokka</groupId>
        <artifactId>dokka-maven-plugin</artifactId>
        <version>${dokka.version}</version>
        <configuration>
          <cacheRoot>default</cacheRoot>
          <sourceRoots>
            <root>
              <path>src/main/kotlin</path>
              <platforms>JVM</platforms>
            </root>
          </sourceRoots>
          <sourceLinks>
            <link>
              <dir>${project.basedir}/src/main/kotlin</dir>
              <url>https://github.com/taymyr/lagom-extensions</url>
              <urlSuffix>#L</urlSuffix>
            </link>
          </sourceLinks>
          <noStdlibLink>false</noStdlibLink>
          <externalDocumentationLinks>
            <link>
              <url>https://www.lagomframework.com/documentation/1.4.x/java/api/</url>
            </link>
            <link>
              <url>https://static.javadoc.io/com.google.guava/guava/26.0-jre/</url>
            </link>
          </externalDocumentationLinks>
        </configuration>
        <executions>
          <execution>
            <phase>prepare-package</phase>
            <goals>
              <goal>javadocJar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>${antrun.plugin.version}</version>
        <executions>
          <execution>
            <id>ktlint</id>
            <phase>verify</phase>
            <configuration>
              <target name="ktlint">
                <java taskname="ktlint" dir="${basedir}" fork="true" failonerror="true"
                      classpathref="maven.plugin.classpath" classname="com.github.shyiko.ktlint.Main">
                  <arg value="src/**/*.kt"/>
                  <!-- see https://github.com/shyiko/ktlint#usage for more -->
                  <arg value="--reporter=plain"/>
                  <arg value="--reporter=checkstyle,output=${project.build.directory}/ktlint.xml"/>
                </java>
              </target>
            </configuration>
            <goals><goal>run</goal></goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.github.shyiko</groupId>
            <artifactId>ktlint</artifactId>
            <version>${ktlint.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${source.plugin.version}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
          <execution>
            <id>attach-javadoc</id>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${jar.plugin.version}</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${surefire.plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco.plugin.version}</version>
        <executions>
          <execution>
            <goals><goal>prepare-agent</goal></goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>test</phase>
            <goals><goal>report</goal></goals>
          </execution>
        </executions>
      </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>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>release</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>
  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>
  <pluginRepositories>
    <pluginRepository>
      <id>jcenter</id>
      <name>JCenter</name>
      <url>https://jcenter.bintray.com/</url>
    </pluginRepository>
  </pluginRepositories>
</project>