<?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>no.kodeworks</groupId>
    <artifactId>kvarg</artifactId>
    <version>0.7</version>
    <name>kvarg</name>
    <inceptionYear>2016</inceptionYear>
    <description>Kvarg</description>
    <url>https://gitlab.com/kodeworks/kvarg</url>
    <packaging>pom</packaging>

    <properties>
        <akka-http.version>10.2.1</akka-http.version>
        <akka-http-cors.version>1.1.0</akka-http-cors.version>
        <akka-http-circe.version>1.35.2</akka-http-circe.version>
        <akka-http-session.version>0.5.11</akka-http-session.version>
        <akka-http-spnego.version>0.5.0</akka-http-spnego.version>
        <akka.version>2.6.10</akka.version>
        <circe.version>0.13.0</circe.version>
        <commons-lang3.version>3.11</commons-lang3.version>
        <commons-codec.version>1.15</commons-codec.version>
        <config.version>1.3.1</config.version>
        <fastparse.version>2.3.0</fastparse.version>
        <h2.version>1.4.200</h2.version>
        <junit.version>4.13.1</junit.version>
        <kittens.version>2.1.0</kittens.version>
        <ldapsdk.version>5.1.1</ldapsdk.version>
        <logback.version>1.2.3</logback.version>
        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
        <maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
        <maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
        <maven-source-plugin.version>3.2.0</maven-source-plugin.version>
        <mouse.version>0.25</mouse.version>
        <mysql-connector-java.version>5.1.38</mysql-connector-java.version>
        <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
        <scala-collection-compat.version>2.1.1</scala-collection-compat.version>
        <scala.version.major>2.13</scala.version.major>
        <scala.version>${scala.version.major}.4</scala.version>
        <scala.typelevel.version>${scala.version}-bin-typelevel-4</scala.typelevel.version>
        <scala-maven-plugin.version>4.4.0</scala-maven-plugin.version>
        <scalamacros.version>2.1.1</scalamacros.version>
        <scalatest.version>3.3.0-SNAP2</scalatest.version>
        <shapeless.version>2.3.3</shapeless.version>
        <simulacrum.version>0.19.0</simulacrum.version>
        <slf4j.version>1.7.25</slf4j.version>
        <slick.version>3.3.3</slick.version>
        <slickless.version>0.3.6</slickless.version>
        <sourcecode.version>0.2.1</sourcecode.version>
        <env>dev</env>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Eirik Larsen</name>
            <email>eirik.larsen@kodeworks.com</email>
            <organization>Kodeworks</organization>
            <organizationUrl>http://kodeworks.no</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:ssh://gitlab.com/kodeworks/kvarg.git</connection>
        <developerConnection>scm:git:ssh://gitlab.com/kodeworks/kvarg</developerConnection>
        <url>https://gitlab.com/kodeworks/kvarg</url>
    </scm>

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

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>${scala-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>compile</goal>
                            <goal>add-source</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>doc-jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!--<scalaOrganization>org.typelevel</scalaOrganization>-->
                    <!--<scalaVersion>${scala.typelevel.version}</scalaVersion>-->
                    <scalaVersion>${scala.version}</scalaVersion>
                    <args>
                        <arg>-deprecation</arg>
                        <arg>-encoding</arg>
                        <arg>UTF-8</arg>
                        <arg>-unchecked</arg>
                        <arg>-feature</arg>
                        <arg>-language:experimental.macros</arg>
                        <arg>-language:implicitConversions</arg>
                        <arg>-language:postfixOps</arg>
                        <arg>-Ymacro-annotations</arg>
                        <arg>-Ywarn-dead-code</arg>
                        <arg>-Xlint</arg>
                        <!--                        <arg>-Xfatal-warnings</arg>-->
                        <!--<arg>-Xlog-implicits</arg>-->
                        <!--<arg>-feature</arg>-->
                        <!--<arg>-Yinduction-heuristics</arg>-->
                        <!--<arg>-Ywarn-extra-implicit</arg>-->
                        <!--<arg>-Ywarn-inaccessible</arg>-->
                        <!--<arg>-Ywarn-infer-any</arg>-->
                        <!--<arg>-Ywarn-nullary-override</arg>-->
                        <!--<arg>-Ywarn-nullary-unit</arg>-->
                        <!--<arg>-Ywarn-numeric-widen</arg>-->
                        <!--<arg>-Ywarn-unused:implicits</arg>-->
                        <!--<arg>-Ywarn-unused:imports</arg>-->
                        <!--<arg>-Ywarn-unused:locals</arg>-->
                        <!--<arg>-Ywarn-unused:params</arg>-->
                        <!--<arg>-Ywarn-unused:patvars</arg>-->
                        <!--<arg>-Ywarn-unused:privates</arg>-->
                        <!--<arg>-Ywarn-value-discard</arg>-->
                    </args>
                    <jvmArgs>
                        <jvmArg>-Xss512m</jvmArg>
                        <jvmArg>-Xms256m</jvmArg>
                        <jvmArg>-Xmx4096m</jvmArg>
                    </jvmArgs>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
                <configuration>
                    <skipIfEmpty>true</skipIfEmpty>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven-resources-plugin.version}</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>${maven.version}</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <modules>
        <module>patch</module>
        <module>filter</module>
        <module>db</module>
        <module>macros</module>
        <module>util</module>
    </modules>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <keyname>${gpg.keyname}</keyname>
                                    <passphraseServerId>${gpg.keyname}</passphraseServerId>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>no-release</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <modules>
                <module>patch-test</module>
                <module>filter-test</module>
                <module>test</module>
            </modules>
        </profile>
    </profiles>
</project>
