<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <modelVersion>4.0.0</modelVersion>
   <groupId>no.nav.helse</groupId>
   <artifactId>streams</artifactId>
   <version>2bd00e2</version>
   <name>helse-streams</name>
   <description>Boilerplate for helse Kafka apps</description>
   <url>https://github.com/navikt/helse-streams</url>

   <properties>
      <kotlin.version>1.3.21</kotlin.version>
      <junit-jupiter.version>5.3.2</junit-jupiter.version>
      <kafka.version>2.0.1</kafka.version>
      <confluent.version>5.0.0</confluent.version>
      <ktor.version>1.1.3</ktor.version>
      <prometheus.version>0.5.0</prometheus.version>
      <spek.version>1.2.1</spek.version>
      <kluent.version>1.41</kluent.version>
      <logback.version>1.2.3</logback.version>
      <logstash.encoder.version>5.2</logstash.encoder.version>
      <maven.compiler.source>11</maven.compiler.source>
      <maven.compiler.target>11</maven.compiler.target>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <jackson.version>2.9.8</jackson.version>
   </properties>

   <repositories>
      <repository>
         <name>jcenter</name>
         <id>jcenter</id>
         <url>http://jcenter.bintray.com/</url>
      </repository>
      <repository>
         <name>confluent</name>
         <id>confluent</id>
         <url>http://packages.confluent.io/maven/</url>
      </repository>
      <repository>
         <name>ktor</name>
         <id>ktor</id>
         <url>https://dl.bintray.com/kotlin/ktor</url>
      </repository>
   </repositories>

   <dependencies>
      <dependency>
         <groupId>org.jetbrains.kotlin</groupId>
         <artifactId>kotlin-stdlib</artifactId>
         <version>${kotlin.version}</version>
      </dependency>
      <dependency>
         <groupId>com.fasterxml.jackson.module</groupId>
         <artifactId>jackson-module-kotlin</artifactId>
         <version>${jackson.version}</version>
      </dependency>
      <dependency>
         <groupId>com.fasterxml.jackson.datatype</groupId>
         <artifactId>jackson-datatype-jsr310</artifactId>
         <version>${jackson.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.kafka</groupId>
         <artifactId>kafka-streams</artifactId>
         <version>${kafka.version}</version>
      </dependency>
      <dependency>
         <groupId>io.confluent</groupId>
         <artifactId>kafka-streams-avro-serde</artifactId>
         <version>${confluent.version}</version>
         <exclusions>
            <exclusion>
               <groupId>org.slf4j</groupId>
               <artifactId>slf4j-log4j12</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>io.ktor</groupId>
         <artifactId>ktor-server-netty</artifactId>
         <version>${ktor.version}</version>
      </dependency>
      <dependency>
         <groupId>io.prometheus</groupId>
         <artifactId>simpleclient_common</artifactId>
         <version>${prometheus.version}</version>
         <scope>compile</scope>
      </dependency>
      <dependency>
         <groupId>io.prometheus</groupId>
         <artifactId>simpleclient_hotspot</artifactId>
         <version>${prometheus.version}</version>
      </dependency>
      <dependency>
         <groupId>ch.qos.logback</groupId>
         <artifactId>logback-classic</artifactId>
         <version>${logback.version}</version>
      </dependency>
      <dependency>
         <groupId>net.logstash.logback</groupId>
         <artifactId>logstash-logback-encoder</artifactId>
         <version>${logstash.encoder.version}</version>
      </dependency>

      <dependency>
         <groupId>org.junit.jupiter</groupId>
         <artifactId>junit-jupiter-api</artifactId>
         <version>${junit-jupiter.version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.amshove.kluent</groupId>
         <artifactId>kluent</artifactId>
         <version>${kluent.version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.jetbrains.spek</groupId>
         <artifactId>spek-api</artifactId>
         <version>${spek.version}</version>
         <scope>test</scope>
         <exclusions>
            <exclusion>
               <artifactId>*</artifactId>
               <groupId>org.jetbrains.kotlin</groupId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>org.junit.jupiter</groupId>
         <artifactId>junit-jupiter-engine</artifactId>
         <version>${junit-jupiter.version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.jetbrains.spek</groupId>
         <artifactId>spek-junit-platform-engine</artifactId>
         <version>${spek.version}</version>
         <scope>test</scope>
         <exclusions>
            <exclusion>
               <artifactId>*</artifactId>
               <groupId>org.junit.platform</groupId>
            </exclusion>
            <exclusion>
               <artifactId>*</artifactId>
               <groupId>org.jetbrains.kotlin</groupId>
            </exclusion>
         </exclusions>
      </dependency>
   </dependencies>

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

         <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.22.0</version>
         </plugin>
         <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
               <execution>
                  <id>include-sources</id>
                  <goals>
                     <goal>jar-no-fork</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.1.0</version>
            <executions>
               <execution>
                  <id>empty-javadoc-jar</id>
                  <phase>package</phase>
                  <goals>
                     <goal>jar</goal>
                  </goals>
                  <configuration>
                     <classifier>javadoc</classifier>
                     <classesDirectory>${basedir}/src/main/javadoc</classesDirectory>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.3</version>
            <configuration>
               <autoVersionSubmodules>true</autoVersionSubmodules>
               <useReleaseProfile>true</useReleaseProfile>
               <releaseProfiles>release</releaseProfiles>
               <goals>deploy</goals>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <executions>
               <execution>
                  <id>default-deploy</id>
                  <phase>deploy</phase>
                  <goals>
                     <goal>deploy</goal>
                  </goals>
               </execution>
            </executions>
            <configuration>
               <nexusUrl>https://oss.sonatype.org/</nexusUrl>
               <serverId>ossrh</serverId>
               <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
         </plugin>

      </plugins>
   </build>

   <licenses>
      <license>
         <name>MIT License</name>
         <url>https://opensource.org/licenses/MIT</url>
      </license>
   </licenses>
   <developers>
      <developer>
         <organization>NAV (Arbeids- og velferdsdirektoratet) - The Norwegian Labour and Welfare Administration</organization>
         <organizationUrl>https://www.nav.no</organizationUrl>
      </developer>
   </developers>
   <distributionManagement>
      <snapshotRepository>
         <id>ossrh</id>
         <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      </snapshotRepository>
      <repository>
         <id>ossrh</id>
         <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
      </repository>
   </distributionManagement>

   <scm>
      <developerConnection>scm:git:git@github.com:navikt/helse-streams.git</developerConnection>
      <connection>scm:git:git@github.com:navikt/helse-streams.git</connection>
      <url>https://github.com/navikt/helse-streams</url>
      <tag>HEAD</tag>
   </scm>

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

</project>

