<?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>org.kiwiproject</groupId>
        <artifactId>kiwi-parent</artifactId>
        <version>3.0.40</version>
    </parent>

    <artifactId>kiwi-beta</artifactId>
    <version>3.1.0</version>
    <name>Kiwi Beta (Experimental Code)</name>
    <description>
        Experimental code that might eventually move into kiwi, or just to try something out...
    </description>
    <url>https://github.com/sleberknight/kiwi-beta</url>
    <inceptionYear>2021</inceptionYear>

    <scm>
        <connection>scm:git:https://github.com/sleberknight/kiwi-beta.git</connection>
        <developerConnection>scm:git:git@github.com:sleberknight/kiwi-beta.git</developerConnection>
        <url>https://github.com/sleberknight/kiwi-beta</url>
        <tag>v3.1.0</tag>
    </scm>

    <properties>
        <kiwi-bom.version>3.3.0</kiwi-bom.version>

        <!-- Kotlin properties -->
        <kotlin.version>2.3.21</kotlin.version>
        <kotlin.compiler.incremental>true</kotlin.compiler.incremental>

        <!-- Versions for required/provided dependencies -->

        <camel.version>4.20.0</camel.version>
        <jakarta.xml.soap-api.version>3.0.2</jakarta.xml.soap-api.version>
        <jakarta.xml.ws-api.version>4.0.3</jakarta.xml.ws-api.version>
        <kiwi.version>5.4.0</kiwi.version>
        <metrics-healthchecks-severity.version>3.1.0</metrics-healthchecks-severity.version>

        <!-- Versions for optional dependencies -->

        <!-- Versions for test dependencies -->
        <kiwi-test.version>4.2.0</kiwi-test.version>
        <mockito-kotlin.version>6.3.0</mockito-kotlin.version>

        <!--  Sonar properties -->
        <sonar.projectKey>sleberknight_kiwi-beta</sonar.projectKey>
        <sonar.organization>sleberknight</sonar.organization>
        <sonar.sources>src/main/java,src/main/kotlin</sonar.sources>
        <sonar.tests>src/test/java,src/test/kotlin</sonar.tests>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!--
                NOTE:
                Override the Kotlin version defined in kiwi-bom; this MUST come before kiwi-bom
                or else the version defined in kiwi-bom takes precedence.
             -->
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-bom</artifactId>
                <version>${kotlin.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

            <dependency>
                <groupId>org.kiwiproject</groupId>
                <artifactId>kiwi-bom</artifactId>
                <version>${kiwi-bom.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

            <dependency>
                <groupId>org.kiwiproject</groupId>
                <artifactId>kiwi</artifactId>
                <version>${kiwi.version}</version>
            </dependency>

            <dependency>
                <groupId>org.kiwiproject</groupId>
                <artifactId>kiwi-test</artifactId>
                <version>${kiwi-test.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

        <!-- required dependencies -->

        <dependency>
            <groupId>org.jspecify</groupId>
            <artifactId>jspecify</artifactId>
        </dependency>

        <dependency>
            <groupId>org.kiwiproject</groupId>
            <artifactId>kiwi</artifactId>
        </dependency>

        <dependency>
            <groupId>org.checkerframework</groupId>
            <artifactId>checker-qual</artifactId>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <!-- provided dependencies -->

        <dependency>
            <groupId>jakarta.ws.rs</groupId>
            <artifactId>jakarta.ws.rs-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <scope>provided</scope>
        </dependency>

        <!--
            Requires compile (provided) scope since the KiwiServletMocks uses AssertJ.
         -->
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-core</artifactId>
            <version>${camel.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-lifecycle</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-logging</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-util</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.hibernate.validator</groupId>
            <artifactId>hibernate-validator</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>jakarta.el</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>jakarta.xml.soap</groupId>
            <artifactId>jakarta.xml.soap-api</artifactId>
            <version>${jakarta.xml.soap-api.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>jakarta.xml.ws</groupId>
            <artifactId>jakarta.xml.ws-api</artifactId>
            <version>${jakarta.xml.ws-api.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.kiwiproject</groupId>
            <artifactId>metrics-healthchecks-severity</artifactId>
            <version>${metrics-healthchecks-severity.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Requires compile (provided) scope since it is used in KiwiServletMocks -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-commons</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- optional dependencies -->

        <dependency>
            <groupId>com.google.errorprone</groupId>
            <artifactId>error_prone_annotations</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- test dependencies -->

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-common</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.kiwiproject</groupId>
            <artifactId>kiwi-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-test-junit5</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito.kotlin</groupId>
            <artifactId>mockito-kotlin</artifactId>
            <version>${mockito-kotlin.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.mockito</groupId>
                    <artifactId>mockito-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>mockwebserver</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <!-- Configuration for Kotlin. For more details, see https://kotlinlang.org/docs/maven.html -->
        <plugins>
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin.version}</version>
                <configuration>
                    <args>
                        <arg>-Xjsr305=strict</arg> <!-- Enable strict mode for JSR-305 annotations -->
                    </args>
                </configuration>
                <executions>
                    <execution>
                        <id>compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <sourceDirs>
                                <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
                                <sourceDir>${project.basedir}/src/main/java</sourceDir>
                            </sourceDirs>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                        <configuration>
                            <sourceDirs>
                                <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
                                <sourceDir>${project.basedir}/src/test/java</sourceDir>
                            </sourceDirs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <release>${maven-compiler-plugin.java.release}</release>
                    <encoding>${maven-compiler-plugin.encoding}</encoding>
                </configuration>
                <executions>
                    <!-- Replacing default-compile as it is treated specially by maven -->
                    <execution>
                        <id>default-compile</id>
                        <phase>none</phase>
                    </execution>
                    <!-- Replacing default-testCompile as it is treated specially by maven -->
                    <execution>
                        <id>default-testCompile</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>java-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>java-test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
