<?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>be.rlab</groupId>
    <artifactId>tehanu</artifactId>
    <packaging>pom</packaging>
    <version>3.3.2</version>

    <name>Tehanu - parent</name>
    <description>Tehanu is a Telegram bot for Kotlin</description>
    <url>https://git.rlab.be/seykron/tehanu</url>
    <licenses>
        <license>
            <name>GPL Version 2.0</name>
            <url>https://www.gnu.org/licenses/old-licenses/gpl-2.0.html</url>
            <distribution>repo</distribution>
            <comments>Free Software License</comments>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>seykron</id>
            <name>seykron</name>
            <email>seykron@rlab.be</email>
            <organization>R'lyeh Hacklab</organization>
            <organizationUrl>https://rlab.be</organizationUrl>
            <roles>
                <role>developer</role>
            </roles>
            <timezone>America/Argentina/Buenos_Aires</timezone>
        </developer>
    </developers>

    <properties>
        <!-- Maven -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <owasp.phase>verify</owasp.phase>

        <junit-jupiter.version>5.7.2</junit-jupiter.version>
        <assertj.version>3.20.2</assertj.version>
        <mockito.version>3.11.2</mockito.version>
        <mockito-kotlin.version>2.2.0</mockito-kotlin.version>
        <bytebuddy.version>[1.11,)</bytebuddy.version>

        <qos.logback.logback-classic.version>1.2.3</qos.logback.logback-classic.version>
        <slf4j.all.version>1.7.31</slf4j.all.version>
        <jackson.mapper.version>2.12.4</jackson.mapper.version>
        <joda.version>2.10.10</joda.version>
        <telegram.version>6.0.4</telegram.version>
        <slack.version>1.9.0</slack.version>
        <springframework.all.version>5.3.9</springframework.all.version>
        <exposed.version>0.32.1</exposed.version>
        <hikaricp.version>5.0.0</hikaricp.version>
        <typesafe.version>1.4.1</typesafe.version>
        <search.version>1.0.0</search.version>
        <websocket.version>1.1</websocket.version>

        <kotlin.version>1.5.21</kotlin.version>
        <kotlin-coroutines.version>1.5.1</kotlin-coroutines.version>
        <kotlin.code.style>official</kotlin.code.style>
    </properties>

    <modules>
        <module>tehanu-core</module>
        <module>tehanu-client-telegram</module>
        <module>tehanu-client-slack</module>
        <module>tehanu-spring</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <!-- Kotlin -->
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-jdk8</artifactId>
                <version>${kotlin.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-reflect</artifactId>
                <version>${kotlin.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.jetbrains.kotlinx</groupId>
                <artifactId>kotlinx-coroutines-core</artifactId>
                <version>${kotlin-coroutines.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-test-junit</artifactId>
                <version>${kotlin.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- Test -->
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit-jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit-jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-inline</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>net.bytebuddy</groupId>
                <artifactId>byte-buddy</artifactId>
                <version>${bytebuddy.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>net.bytebuddy</groupId>
                <artifactId>byte-buddy-agent</artifactId>
                <version>${bytebuddy.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.nhaarman.mockitokotlin2</groupId>
                <artifactId>mockito-kotlin</artifactId>
                <version>${mockito-kotlin.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>${springframework.all.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- Dependency injection -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${springframework.all.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context-support</artifactId>
                <version>${springframework.all.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>javax.inject</groupId>
                <artifactId>javax.inject</artifactId>
                <version>1</version>
            </dependency>

            <!-- Logging -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.all.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
                <version>${slf4j.all.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jul-to-slf4j</artifactId>
                <version>${slf4j.all.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${qos.logback.logback-classic.version}</version>
            </dependency>

            <!-- Serialization -->
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.mapper.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.mapper.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.module</groupId>
                <artifactId>jackson-module-kotlin</artifactId>
                <version>${jackson.mapper.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-joda</artifactId>
                <version>${jackson.mapper.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>joda-time</groupId>
                        <artifactId>joda-time</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jsr310</artifactId>
                <version>${jackson.mapper.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-yaml</artifactId>
                <version>${jackson.mapper.version}</version>
            </dependency>

            <!-- Utils -->
            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>${joda.version}</version>
            </dependency>
            <dependency>
                <groupId>com.typesafe</groupId>
                <artifactId>config</artifactId>
                <version>${typesafe.version}</version>
                <scope>provided</scope>
            </dependency>

            <!-- Slack -->
            <dependency>
                <groupId>javax.websocket</groupId>
                <artifactId>javax.websocket-api</artifactId>
                <version>${websocket.version}</version>
            </dependency>
            <dependency>
                <groupId>com.slack.api</groupId>
                <artifactId>slack-api-client</artifactId>
                <version>${slack.version}</version>
            </dependency>

            <!-- Telegram -->
            <dependency>
                <groupId>io.github.kotlin-telegram-bot.kotlin-telegram-bot</groupId>
                <artifactId>telegram</artifactId>
                <version>6.0.4</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.squareup.retrofit2</groupId>
                        <artifactId>retrofit</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.squareup.okhttp3</groupId>
                        <artifactId>logging-interceptor</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.squareup.retrofit2</groupId>
                <artifactId>retrofit</artifactId>
                <version>2.9.0</version>
            </dependency>
            <dependency>
                <groupId>com.squareup.okhttp3</groupId>
                <artifactId>logging-interceptor</artifactId>
                <version>3.14.9</version>
            </dependency>

            <!-- Data access -->
            <dependency>
                <groupId>org.jetbrains.exposed</groupId>
                <artifactId>exposed-core</artifactId>
                <version>${exposed.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.h2database</groupId>
                        <artifactId>h2</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.exposed</groupId>
                <artifactId>exposed-dao</artifactId>
                <version>${exposed.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.exposed</groupId>
                <artifactId>exposed-jdbc</artifactId>
                <version>${exposed.version}</version>
            </dependency>
            <dependency>
                <groupId>com.zaxxer</groupId>
                <artifactId>HikariCP</artifactId>
                <version>${hikaricp.version}</version>
            </dependency>

            <!-- Search and NLP -->
            <dependency>
                <groupId>be.rlab</groupId>
                <artifactId>kotlin-search</artifactId>
                <version>${search.version}</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <finalName>tehanu</finalName>

        <plugins>
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin.version}</version>
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <jvmTarget>1.8</jvmTarget>
                    <args>
                        <arg>-Xuse-ir</arg>
                    </args>
                </configuration>
            </plugin>
            <!-- Jar plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <excludes>
                        <!-- exclude any logback configuration from the jar -->
                        <exclude>**/logback.xml</exclude>
                        <!-- this line excludes env folder entirely from the jar -->
                        <exclude>**/application.conf</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Release plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <releaseProfiles>release</releaseProfiles>
                    <localCheckout>true</localCheckout>
                    <pushChanges>false</pushChanges>
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <arguments>-Dgpg.passphrase=${gpg.passphrase} -Dgpg.keyname=${gpg.keyname}</arguments>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-gitexe</artifactId>
                        <version>1.11.2</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-api</artifactId>
                        <version>1.11.2</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
                <executions>
                    <execution>
                        <id>default-deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</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>
            <plugin>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <version>6.2.2</version>
                <configuration>
                    <failBuildOnCVSS>8</failBuildOnCVSS>
                    <skipProvidedScope>true</skipProvidedScope>
                    <skipRuntimeScope>true</skipRuntimeScope>
                    <suppressionFiles>${user.dir}/build/owasp-suppressions.xml</suppressionFiles>
                </configuration>
                <executions>
                    <execution>
                        <phase>${owasp.phase}</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!-- Repositories -->
    <repositories>
        <repository>
            <id>kotlin-eap</id>
            <name>Kotlin EAP Repository</name>
            <url>http://dl.bintray.com/kotlin/kotlin-eap</url>
        </repository>
        <repository>
            <id>jcenter</id>
            <name>JCenter Repository</name>
            <url>https://jcenter.bintray.com</url>
        </repository>
        <repository>
            <id>jitpack</id>
            <name>JitPack Repository</name>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>

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

    <!-- SCM -->
    <scm>
        <connection>scm:git:git@git.rlab.be:seykron/tehanu.git</connection>
        <developerConnection>scm:git:git@git.rlab.be:seykron/tehanu.git</developerConnection>
        <url>https://git.rlab.be/seykron/tehanu</url>
        <tag>tehanu-3.3.2</tag>
    </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>

    <profiles>
        <!-- GPG Signature on release -->
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jetbrains.dokka</groupId>
                        <artifactId>dokka-maven-plugin</artifactId>
                        <version>1.5.0</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>javadocJar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <keyname>${gpg.keyname}</keyname>
                                    <passphrase>${gpg.passphrase}</passphrase>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
