<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <!-- Project Coordinates -->
    <groupId>io.github.ktestify</groupId>
    <artifactId>ktestify-parent</artifactId>
    <version>1.0.2</version>
    <packaging>pom</packaging>

    <!-- Project Information -->
    <name>ktestify-parent</name>
    <description>Parent POM for all ktestify module, centralises dependency versions, plugin versions, and shared build configuration</description>
    <url>https://github.com/ktestify/ktestify-parent</url>
    <inceptionYear>2026</inceptionYear>

    <!-- Licenses -->
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <!-- Developers -->
    <developers>
        <developer>
            <id>nil-malh</id>
            <name>Nil MALHOMME</name>
            <email>malhomme.nil+oss@icloud.com</email>
        </developer>
    </developers>

    <!-- SCM Information -->
    <scm>
        <connection>scm:git:git://github.com/ktestify/ktestify-parent.git</connection>
        <developerConnection>scm:git:ssh://github.com:ktestify/ktestify-parent.git</developerConnection>
        <url>https://github.com/ktestify/ktestify-parent/tree/main</url>
    </scm>

    <!-- Issue Management -->
    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/ktestify/ktestify-parent/issues</url>
    </issueManagement>

    <!-- ===================================================== -->
    <!-- Properties — single source of truth for all versions  -->
    <!-- ===================================================== -->
    <properties>
        <!-- Build Properties -->
        <java.version>25</java.version>
        <maven.compiler.release>${java.version}</maven.compiler.release>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- ========================================= -->
        <!-- Dependency Versions (Alphabetically)      -->
        <!-- ========================================= -->
        <awaitility.version>4.3.0</awaitility.version>
        <avro.version>1.12.1</avro.version>
        <commons-cli.version>1.11.0</commons-cli.version>
        <commons-io.version>2.22.0</commons-io.version>
        <commons-lang3.version>3.20.0</commons-lang3.version>
        <confluent.version>8.3.0</confluent.version>
        <cucumber.version>7.34.4</cucumber.version>
        <cucumber-reportr.version>1.3.0</cucumber-reportr.version>
        <gson.version>2.14.0</gson.version>
        <junit.jupiter.version>6.1.1</junit.jupiter.version>
        <kafka.version>4.3.1</kafka.version>
        <lombok.version>1.18.46</lombok.version>
        <mockito.version>5.23.0</mockito.version>
        <jackson.version>2.22.0</jackson.version>
        <log4j2.version>2.26.1</log4j2.version>
        <slf4j.version>2.0.18</slf4j.version>
        <snakeyaml.version>2.6</snakeyaml.version>
        <testcontainers.version>2.0.5</testcontainers.version>
        <testcontainers-kafka.version>2.0.5</testcontainers-kafka.version>
        <typesafe.config.version>1.4.9</typesafe.config.version>
        <xmlunit.version>2.12.0</xmlunit.version>

        <!-- ========================================= -->
        <!-- Maven Plugin Versions (Alphabetically)    -->
        <!-- ========================================= -->
        <exec.plugin.version>3.1.1</exec.plugin.version>
        <jacoco.plugin.version>0.8.15</jacoco.plugin.version>
        <jib.maven.plugin.version>3.5.1</jib.maven.plugin.version>
        <maven.archetype.plugin.version>3.4.1</maven.archetype.plugin.version>
        <maven.compiler.plugin.version>3.15.0</maven.compiler.plugin.version>
        <maven.deploy.plugin.version>3.1.4</maven.deploy.plugin.version>
        <maven.gpg.plugin.version>3.2.8</maven.gpg.plugin.version>
        <maven.install.plugin.version>3.1.4</maven.install.plugin.version>
        <maven.jar.plugin.version>3.5.0</maven.jar.plugin.version>
        <maven.javadoc.plugin.version>3.12.0</maven.javadoc.plugin.version>
        <maven.resources.plugin.version>3.5.0</maven.resources.plugin.version>
        <maven.shade.plugin.version>3.6.2</maven.shade.plugin.version>
        <maven.source.plugin.version>3.4.0</maven.source.plugin.version>
        <maven.surefire.plugin.version>3.5.6</maven.surefire.plugin.version>
        <sonar.plugin.version>5.5.0.6356</sonar.plugin.version>
        <spotless.plugin.version>3.8.0</spotless.plugin.version>
        <versions.plugin.version>2.21.0</versions.plugin.version>
        <central.publishing.plugin.version>0.11.0</central.publishing.plugin.version>
    </properties>

    <!-- ===================================================== -->
    <!-- Dependency Management — version alignment             -->
    <!-- ===================================================== -->
    <dependencyManagement>
        <dependencies>
            <!--
                Pin ALL com.fasterxml.jackson.* modules to the same version.
                Without this, transitive deps pull in mixed patch versions which
                causes ObjectMapper's static initializer to throw
                NoClassDefFoundError at runtime.
            -->
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${jackson.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- ===================================== -->
            <!-- Apache Commons                        -->
            <!-- ===================================== -->
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons-lang3.version}</version>
            </dependency>

            <!-- ===================================== -->
            <!-- Gson                                  -->
            <!-- ===================================== -->
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>${gson.version}</version>
            </dependency>

            <!-- ===================================== -->
            <!-- Lombok                                -->
            <!-- ===================================== -->
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
                <scope>provided</scope>
            </dependency>

            <!-- ===================================== -->
            <!-- Typesafe Config (HOCON)               -->
            <!-- ===================================== -->
            <dependency>
                <groupId>com.typesafe</groupId>
                <artifactId>config</artifactId>
                <version>${typesafe.config.version}</version>
            </dependency>

            <!-- ===================================== -->
            <!-- XMLUnit                               -->
            <!-- ===================================== -->
            <dependency>
                <groupId>org.xmlunit</groupId>
                <artifactId>xmlunit-core</artifactId>
                <version>${xmlunit.version}</version>
            </dependency>
            <dependency>
                <groupId>org.xmlunit</groupId>
                <artifactId>xmlunit-matchers</artifactId>
                <version>${xmlunit.version}</version>
            </dependency>

            <!-- ===================================== -->
            <!-- Logging                               -->
            <!-- ===================================== -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j2-impl</artifactId>
                <version>${log4j2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${log4j2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j2.version}</version>
            </dependency>

            <!-- ===================================== -->
            <!-- Kafka                                 -->
            <!-- ===================================== -->
            <dependency>
                <groupId>org.apache.kafka</groupId>
                <artifactId>kafka-clients</artifactId>
                <version>${kafka.version}</version>
            </dependency>

            <!-- ===================================== -->
            <!-- Confluent                             -->
            <!-- ===================================== -->
            <dependency>
                <groupId>io.confluent</groupId>
                <artifactId>kafka-schema-registry-client</artifactId>
                <version>${confluent.version}</version>
            </dependency>
            <dependency>
                <groupId>io.confluent</groupId>
                <artifactId>kafka-streams-avro-serde</artifactId>
                <version>${confluent.version}</version>
            </dependency>
            <dependency>
                <groupId>io.confluent</groupId>
                <artifactId>kafka-avro-serializer</artifactId>
                <version>${confluent.version}</version>
            </dependency>

            <!-- ===================================== -->
            <!-- Avro                                  -->
            <!-- ===================================== -->
            <dependency>
                <groupId>org.apache.avro</groupId>
                <artifactId>avro</artifactId>
                <version>${avro.version}</version>
            </dependency>

            <!-- ===================================== -->
            <!-- Cucumber                              -->
            <!-- ===================================== -->
            <dependency>
                <groupId>io.cucumber</groupId>
                <artifactId>cucumber-core</artifactId>
                <version>${cucumber.version}</version>
            </dependency>
            <dependency>
                <groupId>io.cucumber</groupId>
                <artifactId>cucumber-java</artifactId>
                <version>${cucumber.version}</version>
            </dependency>
            <dependency>
                <groupId>io.cucumber</groupId>
                <artifactId>cucumber-junit</artifactId>
                <version>${cucumber.version}</version>
            </dependency>
            <dependency>
                <groupId>io.cucumber</groupId>
                <artifactId>cucumber-picocontainer</artifactId>
                <version>${cucumber.version}</version>
            </dependency>

            <!-- ===================================== -->
            <!-- Cucumber Reporting                    -->
            <!-- ===================================== -->
            <dependency>
                <groupId>io.github.nil-malh</groupId>
                <artifactId>cucumber-reportr</artifactId>
                <version>${cucumber-reportr.version}</version>
            </dependency>

            <!-- ===================================== -->
            <!-- JUnit 5                               -->
            <!-- ===================================== -->
            <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.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${junit.jupiter.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- ===================================== -->
            <!-- Mockito                               -->
            <!-- ===================================== -->
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- ===================================== -->
            <!-- Testcontainers                        -->
            <!-- ===================================== -->
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers</artifactId>
                <version>${testcontainers.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers-junit-jupiter</artifactId>
                <version>${testcontainers.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers-kafka</artifactId>
                <version>${testcontainers-kafka.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <!-- ===================================================== -->
    <!-- Repositories                                          -->
    <!-- ===================================================== -->
    <repositories>
        <repository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>confluent</id>
            <url>https://packages.confluent.io/maven/</url>
        </repository>
    </repositories>

    <!-- ===================================================== -->
    <!-- Plugin Management — shared build configuration        -->
    <!-- ===================================================== -->
    <build>
        <pluginManagement>
            <plugins>
                <!-- ===================================== -->
                <!-- Compiler Plugin                       -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compiler.plugin.version}</version>
                    <configuration>
                        <release>${java.version}</release>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>

                <!-- ===================================== -->
                <!-- Resources Plugin                      -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven.resources.plugin.version}</version>
                    <configuration>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>

                <!-- ===================================== -->
                <!-- JAR Plugin                            -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven.jar.plugin.version}</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            </manifest>
                            <manifestEntries>
                                <Built-By>${user.name}</Built-By>
                                <Build-Time>${maven.build.timestamp}</Build-Time>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>

                <!-- ===================================== -->
                <!-- Surefire Plugin (unit tests)          -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven.surefire.plugin.version}</version>
                    <configuration>
                        <includes>
                            <include>**/*Test.java</include>
                            <include>**/*Tests.java</include>
                        </includes>
                        <argLine>@{argLine}
                            -Xmx1024m
                            -XX:+EnableDynamicAgentLoading</argLine>
                    </configuration>
                </plugin>

                <!-- ===================================== -->
                <!-- Failsafe Plugin (integration tests)   -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven.surefire.plugin.version}</version>
                    <configuration>
                        <includes>
                            <include>**/*IT.java</include>
                        </includes>
                        <argLine>-Xmx1024m -XX:+EnableDynamicAgentLoading</argLine>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- ===================================== -->
                <!-- JaCoCo for Code Coverage              -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>jacoco-initialize</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>jacoco-report</id>
                            <goals>
                                <goal>report</goal>
                            </goals>
                            <phase>test</phase>
                        </execution>
                    </executions>
                </plugin>

                <!-- ===================================== -->
                <!-- Spotless Plugin                       -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>com.diffplug.spotless</groupId>
                    <artifactId>spotless-maven-plugin</artifactId>
                    <version>${spotless.plugin.version}</version>
                    <configuration>
                        <java>
                            <includes>
                                <include>src/main/java/**/*.java</include>
                                <include>src/test/java/**/*.java</include>
                            </includes>
                            <palantirJavaFormat>
                                <version>2.90.0</version>
                                <style>PALANTIR</style>
                                <formatJavadoc>true</formatJavadoc>
                            </palantirJavaFormat>
                            <removeUnusedImports/>
                            <formatAnnotations/>
                            <importOrder/>
                            <trimTrailingWhitespace/>
                            <endWithNewline/>
                            <licenseHeader>
                                <file>.spotless/HEADER.txt</file>
                            </licenseHeader>
                        </java>
                        <pom>
                            <includes>
                                <include>pom.xml</include>
                            </includes>
                            <sortPom>
                                <encoding>UTF-8</encoding>
                                <keepBlankLines>true</keepBlankLines>
                                <nrOfIndentSpace>4</nrOfIndentSpace>
                                <expandEmptyElements>false</expandEmptyElements>
                            </sortPom>
                        </pom>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                            </goals>
                            <phase>package</phase>
                        </execution>
                    </executions>
                </plugin>

                <!-- ===================================== -->
                <!-- Source Plugin (for open source)       -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven.source.plugin.version}</version>
                </plugin>

                <!-- ===================================== -->
                <!-- Javadoc Plugin (for open source)      -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven.javadoc.plugin.version}</version>
                    <configuration>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <doclint>none</doclint>
                        <quiet>true</quiet>
                    </configuration>
                </plugin>

                <!-- ===================================== -->
                <!-- Install Plugin                        -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven.install.plugin.version}</version>
                </plugin>

                <!-- ===================================== -->
                <!-- Deploy Plugin                         -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven.deploy.plugin.version}</version>
                </plugin>

                <!-- ===================================== -->
                <!-- Versions Plugin                       -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${versions.plugin.version}</version>
                    <configuration>
                        <generateBackupPoms>false</generateBackupPoms>
                    </configuration>
                </plugin>

                <!-- ===================================== -->
                <!-- GPG Plugin (release profile)          -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven.gpg.plugin.version}</version>
                    <configuration>
                        <gpgArguments>
                            <arg>--pinentry-mode</arg>
                            <arg>loopback</arg>
                        </gpgArguments>
                    </configuration>
                </plugin>

                <!-- ===================================== -->
                <!-- Central Publishing Plugin             -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>${central.publishing.plugin.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <publishingServerId>central</publishingServerId>
                        <autoPublish>true</autoPublish>
                        <waitUntil>published</waitUntil>
                        <deploymentName>${project.artifactId}-${project.version}</deploymentName>
                    </configuration>
                </plugin>

                <!-- ===================================== -->
                <!-- Shade Plugin (fat JAR — opt-in)       -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven.shade.plugin.version}</version>
                </plugin>

                <!-- ===================================== -->
                <!-- JIB Plugin (container image — opt-in) -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>com.google.cloud.tools</groupId>
                    <artifactId>jib-maven-plugin</artifactId>
                    <version>${jib.maven.plugin.version}</version>
                </plugin>

                <!-- ===================================== -->
                <!-- Archetype Plugin (opt-in)             -->
                <!-- ===================================== -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-archetype-plugin</artifactId>
                    <version>${maven.archetype.plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <!-- ===================================================== -->
        <!-- Plugins — always active for all child modules         -->
        <!-- ===================================================== -->
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!-- ===================================================== -->
    <!-- Profiles — shared across all modules                  -->
    <!-- ===================================================== -->
    <profiles>
        <!-- Profile for signing artifacts and publishing to Maven Central -->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- GPG signing (required by Maven Central) -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <phase>verify</phase>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Maven Central Portal publisher -->
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Profile for skipping tests -->
        <profile>
            <id>skip-tests</id>
            <properties>
                <maven.test.skip>true</maven.test.skip>
            </properties>
        </profile>

        <!-- Profile for integration tests -->
        <profile>
            <id>integration-tests</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
