<?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.44</version>
    </parent>

    <artifactId>dynamodb-leader-latch</artifactId>
    <version>0.1.0</version>
    <packaging>jar</packaging>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>
        A small library providing leader election for multiple instances of the same logical service,
        using Amazon DynamoDB (via the AWS Labs amazon-dynamodb-lock-client) as the backend.
    </description>
    <url>https://github.com/kiwiproject/dynamodb-leader-latch</url>
    <inceptionYear>2026</inceptionYear>

    <scm>
        <connection>scm:git:https://github.com/kiwiproject/dynamodb-leader-latch.git</connection>
        <developerConnection>scm:git:git@github.com:kiwiproject/dynamodb-leader-latch.git</developerConnection>
        <url>https://github.com/kiwiproject/dynamodb-leader-latch</url>
        <tag>v0.1.0</tag>
    </scm>

    <properties>

        <!-- Versions for required dependencies -->
        <kiwi.version>5.4.0</kiwi.version>
        <kiwi-bom.version>3.3.4</kiwi-bom.version>
        <aws-sdk.version>2.55.12</aws-sdk.version>
        <dynamodb-lock-client.version>1.5.0</dynamodb-lock-client.version>

        <!-- Versions for test dependencies -->
        <kiwi-test.version>4.3.0</kiwi-test.version>
        <dynamodb-local.version>2.6.1</dynamodb-local.version>
        <log4j.version>2.26.1</log4j.version>

        <!-- Sonar properties -->
        <sonar.projectKey>kiwiproject_dynamodb-leader-latch</sonar.projectKey>
    </properties>

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

            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>bom</artifactId>
                <version>${aws-sdk.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- DynamoDB Local (test scope only) brings in an old log4j; override it with a current version -->
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-bom</artifactId>
                <version>${log4j.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </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>com.amazonaws</groupId>
            <artifactId>dynamodb-lock-client</artifactId>
            <version>${dynamodb-lock-client.version}</version>
            <exclusions>
                <!--
                    The lock client declares AWS SDK modules at an older version (2.32.10). Consumers of this library
                    do not inherit our AWS SDK BOM import, so they would end up with a mix of SDK versions. Exclude them
                    and rely on the software.amazon.awssdk:dynamodb dependency below, which brings in all the SDK
                    modules the lock client needs, all at the same version.
                -->
                <exclusion>
                    <groupId>software.amazon.awssdk</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>dynamodb</artifactId>
        </dependency>

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

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

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

        <!-- test dependencies -->

        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>DynamoDBLocal</artifactId>
            <version>${dynamodb-local.version}</version>
            <scope>test</scope>
            <exclusions>
                <!-- route DynamoDB Local's Log4j 2 API calls to SLF4J (logback) instead -->
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-to-slf4j</artifactId>
            <scope>test</scope>
        </dependency>

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

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

    </dependencies>

</project>
