<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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>io.confluent</groupId>
        <artifactId>rest-utils-parent</artifactId>
        <version>7.6.7</version>
    </parent>

    <artifactId>metadata-service-parent</artifactId>
    <packaging>pom</packaging>
    <name>metadata-service</name>
    <version>7.6.7</version>

    <organization>
        <name>Confluent, Inc.</name>
        <url>http://confluent.io</url>
    </organization>
    <url>http://confluent.io</url>
    <description>
    	Metadata Service primarily implementing RBAC security.
    </description>

    <licenses>
        <license>
            <name>Confluent License Agreement</name>
            <url>https://www.confluent.io/legal/confluent-license-agreement/</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/confluentinc/metadata-service.git</connection>
        <developerConnection>scm:git:git@github.com:confluentinc/metadata-service.git</developerConnection>
        <url>https://github.com/confluentinc/metadata-service</url>
        <tag>HEAD</tag>
    </scm>

    <modules>
        <module>mds-test-tools</module>
        <module>testing-ldap</module>
        <module>testing-ldap-cli</module>
        <module>rbac-common</module>

        <module>rbac-api-server</module>
        <!-- Default profile only runs a set of smoke tests in rbac-api-perf.
             Use maven profile testLarge (-PtestLarge) -->
        <module>rbac-api-perf</module>
        <module>cp-sso</module>
    </modules>

    <properties>
        <auto-value.version>1.8.1</auto-value.version>
        <confluent.maven.repo>https://packages.confluent.io/maven/</confluent.maven.repo>
        <checkstyle.suppressions.location>checkstyle/suppressions.xml</checkstyle.suppressions.location>
        <testng.version>7.5.1</testng.version> <!-- 7.5 is the last version to support jdk8 -->
        <hikari.version>3.4.5</hikari.version>
        <jakarta-rs-api.version>2.1.6</jakarta-rs-api.version>
        <jna.version>5.13.0</jna.version>

        <maven-surefire-plugin-module.version>3.0.0-M9</maven-surefire-plugin-module.version>

        <jakarta-rs-api.version>2.1.6</jakarta-rs-api.version>
        <events-schema.version>0.203.0</events-schema.version>
        <argparse4j.version>0.8.1</argparse4j.version>
        <retrofit.version>2.9.0</retrofit.version>
        <awaitility.version>4.0.2</awaitility.version>
        <logredactor.version>1.0.11</logredactor.version>
        <io.confluent.metadata-service.version>7.6.7</io.confluent.metadata-service.version>
        <io.confluent.confluent-security-plugins.version>${confluent.version.range}</io.confluent.confluent-security-plugins.version>
        <io.confluent.ce-kafka-http-server.version>${confluent.version.range}</io.confluent.ce-kafka-http-server.version>

        <!-- as of 2021-10 common pom does not use/define a maven shade version so we have to -->
        <maven-shade-plugin-module.version>3.2.4</maven-shade-plugin-module.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Override common/pom.xml, to force CE versioned transitive dependencies instead of CCS -->
            <dependency>
                <groupId>org.apache.kafka</groupId>
                <artifactId>kafka_${kafka.scala.version}</artifactId>
                <version>${ce.kafka.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-log4j12</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!-- Due to an outdated auditlog-emitter and interesting dependency issue, pin the telemetry-events verison
            to one matching the current release -->
            <dependency>
                <groupId>io.confluent</groupId>
                <artifactId>telemetry-events</artifactId>
                <version>${ce.kafka.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.kafka</groupId>
                <artifactId>kafka-streams</artifactId>
                <version>${ce.kafka.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.kafka</groupId>
                <artifactId>kafka-clients</artifactId>
                <version>${ce.kafka.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-log4j12</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.apache.kafka</groupId>
                <artifactId>kafka-clients</artifactId>
                <version>${ce.kafka.version}</version>
                <classifier>test</classifier>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-log4j12</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>jakarta.ws.rs</groupId>
                <artifactId>jakarta.ws.rs-api</artifactId>
                <version>${jakarta-rs-api.version}</version>
            </dependency>

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

            <dependency>
                <groupId>net.sourceforge.argparse4j</groupId>
                <artifactId>argparse4j</artifactId>
                <version>${argparse4j.version}</version>
            </dependency>

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

            <!-- Common utility libraries -->

            <dependency>
                <groupId>com.google.auto.value</groupId>
                <artifactId>auto-value-annotations</artifactId>
                <version>${auto-value.version}</version>
            </dependency>

            <!-- Logging things -->
            <dependency>
                <groupId>io.confluent</groupId>
                <artifactId>logredactor</artifactId>
                <version>1.0.10</version>
            </dependency>

            <!-- For a Nice Java-y type safe Client -->
            <dependency>
                <groupId>com.squareup.retrofit2</groupId>
                <artifactId>retrofit</artifactId>
                <version>${retrofit.version}</version>
            </dependency>
            <dependency>
                <groupId>com.squareup.retrofit2</groupId>
                <artifactId>converter-jackson</artifactId>
                <version>${retrofit.version}</version>
            </dependency>
            <dependency>
                <groupId>com.squareup.retrofit2</groupId>
                <artifactId>converter-scalars</artifactId>
                <version>${retrofit.version}</version>
            </dependency>

            <dependency>
                <groupId>io.confluent</groupId>
                <artifactId>ce-kafka-http-server</artifactId>
                <version>${io.confluent.ce-kafka-http-server.version}</version>
            </dependency>

            <!-- Regression fix: mina-core is test scoped in main project
            compile scope in testing-ldap and testing-ldap-cli
            updating to version that resolves the CVEs: 2.0.27 instead
            of 2.2.4 as the latest version as of 1/15/2025 was causing
            test failures  -->
            <dependency>
                <groupId>org.apache.mina</groupId>
                <artifactId>mina-core</artifactId>
                <version>2.0.27</version>
            </dependency>

            <dependency>
                <groupId>io.confluent</groupId>
                <artifactId>confluent-security-plugins-common</artifactId>
                <version>${io.confluent.confluent-security-plugins.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <id>confluent</id>
            <name>Confluent</name>
            <url>${confluent.maven.repo}</url>
        </repository>
    </repositories>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven-shade-plugin-module.version}</version>
                </plugin>

                <!--
                We are setting the version of surefire and failsafe to run here.
                However, each submodule will have to declare which test test runner it actually
                    wants to use
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin-module.version}</version>
                    <configuration>
                        <!--
                            -DskipTests=true skips both unit and integration tests.
                            This give us the ability to just skip unit tests with
                            -DskipUnitTests=true
                             -->
                        <skip>${skipUnitTests}</skip>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven-surefire-plugin-module.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>cloudPackageSmokeTest</id>
            <activation>
                <property>
                    <name>MDS_CLOUD_SMOKE_TESTS</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
                <skipUnitTests>true</skipUnitTests>
            </properties>
            <build>
                <defaultGoal>verify</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <!-- Suppress the Junit Integration test group definition inherited from common, as
                             TestNG will see it and try to respect it. -->
                        <configuration combine.self="override">
                            <skip>true</skip>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
