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

    <parent>
        <groupId>no.ks.fiks.pom</groupId>
        <artifactId>fiks-ekstern-kotlin-superpom</artifactId>
        <version>1.0.15</version>
    </parent>

    <groupId>no.ks</groupId>
    <artifactId>k-es</artifactId>
    <version>3.0.7</version>
    <packaging>pom</packaging>
    <description>${project.artifactId}: An eventsourcing framework for Kotlin, with adapters for EventStore</description>
    <url>https://github.com/ks-no/k-es</url>

    <modules>
        <module>k-es-bom</module>
        <module>k-es-esjc</module>
        <module>k-es-grpc</module>
        <module>k-es-lib</module>
        <module>k-es-jdbc</module>
        <module>k-es-serdes-jackson</module>
        <module>k-es-serdes-proto</module>
        <module>k-es-test-support</module>
        <module>k-es-demo-app-proto-events</module>
        <module>k-es-demo-app-proto</module>
        <module>k-es-demo-app-grpc-jackson</module>
        <module>k-es-mongodb</module>
        <!--        <module>k-es-demo-app-jackson</module>-->
    </modules>
    <scm>
        <connection>scm:git:git@github.com:ks-no/k-es.git</connection>
        <developerConnection>scm:git:git@github.com:ks-no/k-es.git</developerConnection>
        <url>https://github.com/ks-no/k-es</url>
    </scm>


    <properties>
        <java.version>11</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-versions-plugin.version>2.12.0</maven-versions-plugin.version>
        <maven-enforcer-plugin.version>3.1.0</maven-enforcer-plugin.version>
        <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>

        <kotlin.version>1.7.10</kotlin.version>
        <jackson.version>2.13.4</jackson.version>
        <slf4j.version>1.7.36</slf4j.version>
        <esjc.version>2.7.0</esjc.version>
        <spring.version>5.3.22</spring.version>
        <logback.version>1.2.11</logback.version>
        <kotlin-logging.version>2.1.23</kotlin-logging.version>
        <mockk.version>1.12.7</mockk.version>
        <kotest.version>5.3.2</kotest.version>
        <kotest.testcontainers.version>1.3.4</kotest.testcontainers.version>
        <kotest.spring.version>1.1.2</kotest.spring.version>
        <jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
        <junit.jupiter.version>5.9.0</junit.jupiter.version>
        <testcontainers.version>1.17.3</testcontainers.version>
        <mssql-jdbc.version>11.2.1.jre11</mssql-jdbc.version>
        <protobuf-java.version>3.21.5</protobuf-java.version>
        <testcontainers.version>1.15.2</testcontainers.version>
        <spring-boot-version>2.7.3</spring-boot-version>
        <mongodb-driver-version>4.7.1</mongodb-driver-version>
        <spring-boot-version>2.7.1</spring-boot-version>
        <kotlinx-coroutines.version>1.6.4</kotlinx-coroutines.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Kotlin bom -->
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-bom</artifactId>
                <version>${kotlin.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- /Kotlin bom -->
            <!-- Kotlin coroutines bom -->
            <dependency>
                <groupId>org.jetbrains.kotlinx</groupId>
                <artifactId>kotlinx-coroutines-bom</artifactId>
                <version>${kotlinx-coroutines.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- /Kotlin coroutines bom -->
            <!-- Internal deps -->
            <dependency>
                <groupId>no.ks</groupId>
                <artifactId>k-es-lib</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>no.ks</groupId>
                <artifactId>k-es-esjc</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>no.ks</groupId>
                <artifactId>k-es-grpc</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>no.ks</groupId>
                <artifactId>k-es-mongodb</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>no.ks</groupId>
                <artifactId>k-es-jdbc</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>no.ks</groupId>
                <artifactId>k-es-serdes-jackson</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>no.ks</groupId>
                <artifactId>k-es-demo-app-proto-events</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>no.ks</groupId>
                <artifactId>k-es-serdes-proto</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>no.ks</groupId>
                <artifactId>k-es-test-support</artifactId>
                <version>${project.version}</version>
            </dependency>
            <!-- /Internal deps -->
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.jupiter.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>no.ks.fiks</groupId>
                <artifactId>fiks-esjc</artifactId>
                <version>${esjc.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.microutils</groupId>
                <artifactId>kotlin-logging-jvm</artifactId>
                <version>${kotlin-logging.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${jackson.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java</artifactId>
                <version>${protobuf-java.version}</version>
            </dependency>

            <!-- kotest -->
            <dependency>
                <groupId>io.kotest</groupId>
                <artifactId>kotest-core-jvm</artifactId>
                <version>${kotest.version}</version>
            </dependency>
            <dependency>
                <groupId>io.kotest</groupId>
                <artifactId>kotest-runner-junit5-jvm</artifactId>
                <version>${kotest.version}</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>org.jetbrains.kotlinx</groupId>
                        <artifactId>kotlinx-coroutines-bom</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>io.kotest</groupId>
                <artifactId>kotest-property-jvm</artifactId>
                <version>${kotest.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.kotest</groupId>
                <artifactId>kotest-assertions-core-jvm</artifactId>
                <version>${kotest.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.kotest</groupId>
                <artifactId>kotest-assertions-json-jvm</artifactId>
                <version>${kotest.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.kotest.extensions</groupId>
                <artifactId>kotest-extensions-testcontainers</artifactId>
                <version>${kotest.testcontainers.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.kotest.extensions</groupId>
                <artifactId>kotest-extensions-spring</artifactId>
                <version>${kotest.spring.version}</version>
                <scope>test</scope>
            </dependency>
            <!-- /kotest -->

            <dependency>
                <groupId>io.mockk</groupId>
                <artifactId>mockk</artifactId> <!-- Trenger fortsatt denne pga transitiv dep -->
                <version>${mockk.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.mockk</groupId>
                <artifactId>mockk-jvm</artifactId>
                <version>${mockk.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers-bom</artifactId>
                <version>${testcontainers.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.microsoft.sqlserver</groupId>
                <artifactId>mssql-jdbc</artifactId>
                <version>${mssql-jdbc.version}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>


    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <inherited>true</inherited>
                <executions>
                    <execution>
                        <id>default-cli</id>
                        <configuration>
                            <rules>
                                <requireReleaseVersion/>
                                <requireReleaseDeps />
                            </rules>
                        </configuration>
                    </execution>
                    <execution>
                        <id>validate-snap</id>
                        <configuration>
                            <rules>
                                <requireSnapshotVersion>
                                    <failWhenParentIsRelease>false</failWhenParentIsRelease>
                                </requireSnapshotVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <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>${java.version}</jvmTarget>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>prepare-jacoco-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <pluginManagement>

            <plugins>

                <plugin>

                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-maven-plugin</artifactId>
                    <version>${kotlin.version}</version>
                    <configuration>
                        <jvmTarget>${java.version}</jvmTarget>
                        <languageVersion>1.6</languageVersion>
                        <apiVersion>1.6</apiVersion>
                    </configuration>
                    <executions>
                        <execution>
                            <id>compile</id>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                        </execution>

                        <execution>
                            <id>test-compile</id>
                            <goals>
                                <goal>test-compile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${maven-versions-plugin.version}</version>
                </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-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <release>${java.version}</release>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>
