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

    <groupId>com.michelin</groupId>
    <artifactId>kstreamplify</artifactId>
    <version>1.8.0</version>
    <packaging>pom</packaging>
    <name>kstreamplify</name>
    <description>Swiftly build and enhance your Kafka Streams applications.</description>
    <url>https://github.com/michelin/kstreamplify</url>

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

    <developers>
        <developer>
            <id>sebastienviale</id>
            <name>Sebastien Viale</name>
            <email>dif-hap-dev@michelin.com</email>
            <url>https://github.com/sebastienviale</url>
            <organization>Michelin</organization>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
        <developer>
            <id>clvacher</id>
            <name>Clement Vacher</name>
            <email>dif-hap-dev@michelin.com</email>
            <url>https://github.com/clvacher</url>
            <organization>CGI</organization>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
        <developer>
            <id>alexbosch3000</id>
            <name>Alexandre Bosch</name>
            <email>dif-hap-dev@michelin.com</email>
            <url>https://github.com/alexbosch3000</url>
            <organization>Michelin</organization>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
        <developer>
            <id>clvacher</id>
            <name>Clement Vacher</name>
            <email>dif-hap-dev@michelin.com</email>
            <url>https://github.com/clvacher</url>
            <organization>CGI</organization>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
        <developer>
            <id>loicgreffier</id>
            <name>Loïc Greffier</name>
            <email>loic.greffier@michelin.com</email>
            <url>https://github.com/loicgreffier</url>
            <organization>Michelin</organization>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
        <developer>
            <id>adriencalime</id>
            <name>Adrien Calime</name>
            <email>dif-hap-dev@michelin.com</email>
            <url>https://github.com/adriencalime</url>
            <organization>Michelin</organization>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
    </developers>

    <modules>
        <module>kstreamplify-core</module>
        <module>kstreamplify-core-test</module>
        <module>kstreamplify-spring-boot</module>
    </modules>

    <scm>
        <connection>scm:git:https://github.com/michelin/kstreamplify.git</connection>
        <developerConnection>scm:git:https://github.com/michelin/kstreamplify.git</developerConnection>
        <url>scm:git:https://github.com/michelin/kstreamplify.git</url>
    </scm>

    <properties>
        <avro-maven-plugin.version>1.12.1</avro-maven-plugin.version>
        <central-publishing-maven-plugin.version>0.11.0</central-publishing-maven-plugin.version>
        <commons-io.version>2.22.0</commons-io.version>
        <commons-lang3.version>3.20.0</commons-lang3.version>
        <gson.version>2.14.0</gson.version>
        <jackson-core.version>3.0.4</jackson-core.version>
        <jacoco-maven-plugin.version>0.8.15</jacoco-maven-plugin.version>
        <junit-jupiter.version>6.1.0</junit-jupiter.version>
        <kafka-streams-avro-serde.version>8.3.0</kafka-streams-avro-serde.version>
        <kafka.version>4.3.1</kafka.version>
        <maven-compiler-plugin.version>3.15.0</maven-compiler-plugin.version>
        <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
        <maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
        <maven-source-plugin.version>3.4.0</maven-source-plugin.version>
        <maven-surefire-plugin.version>3.5.6</maven-surefire-plugin.version>
        <maven.compiler.java.version>17</maven.compiler.java.version>
        <mockito.version>5.23.0</mockito.version>
        <palantir.version>2.80.0</palantir.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <sonar-maven-plugin.version>5.7.0.6970</sonar-maven-plugin.version>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        <sonar.organization>michelin</sonar.organization>
        <sonar.projectKey>michelin_kstreamplify</sonar.projectKey>
        <spotless-maven-plugin.version>3.7.0</spotless-maven-plugin.version>
        <spring-boot.version>4.1.0</spring-boot.version>
        <springdoc.version>3.0.3</springdoc.version>
        <testcontainers.version>2.0.5</testcontainers.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io.version}</version>
        </dependency>

        <dependency>
            <groupId>io.confluent</groupId>
            <artifactId>kafka-streams-avro-serde</artifactId>
            <version>${kafka-streams-avro-serde.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>

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

        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-streams</artifactId>
            <version>${kafka.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-streams-test-utils</artifactId>
            <version>${kafka.version}</version>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit-jupiter.version}</version>
        </dependency>

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

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>

        <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.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>confluent</id>
            <url>https://packages.confluent.io/maven/</url>
        </repository>
    </repositories>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.avro</groupId>
                    <artifactId>avro-maven-plugin</artifactId>
                    <version>${avro-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>schema</goal>
                            </goals>
                            <phase>generate-sources</phase>
                            <configuration>
                                <stringType>String</stringType>
                                <enableDecimalLogicalType>true</enableDecimalLogicalType>
                                <sourceDirectory>${project.basedir}/src/main/avro</sourceDirectory>
                                <outputDirectory>${project.basedir}/target/generated-sources</outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${spotless-maven-plugin.version}</version>
                <configuration>
                    <java>
                        <includes>
                            <include>src/main/java/**/*.java</include>
                            <include>src/test/java/**/*.java</include>
                        </includes>
                        <palantirJavaFormat>
                            <version>${palantir.version}</version>
                            <style>PALANTIR</style>
                            <formatJavadoc>true</formatJavadoc>
                        </palantirJavaFormat>
                        <removeUnusedImports />
                        <formatAnnotations />
                        <importOrder />
                        <trimTrailingWhitespace />
                        <endWithNewline />
                        <licenseHeader>
                            <file>${maven.multiModuleProjectDirectory}/.spotless/HEADER</file>
                        </licenseHeader>
                    </java>
                    <pom>
                        <includes>
                            <include>pom.xml</include>
                        </includes>
                        <sortPom>
                            <nrOfIndentSpace>4</nrOfIndentSpace>
                            <expandEmptyElements>false</expandEmptyElements>
                            <spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
                            <sortDependencies>groupId,artifactId</sortDependencies>
                            <sortDependencyManagement>groupId,artifactId</sortDependencyManagement>
                            <sortDependencyExclusions>groupId,artifactId</sortDependencyExclusions>
                            <sortPlugins>groupId,artifactId</sortPlugins>
                            <sortProperties>true</sortProperties>
                            <sortModules>true</sortModules>
                            <endWithNewline />
                        </sortPom>
                    </pom>
                    <yaml>
                        <includes>
                            <include>src/main/resources/*.yml</include>
                            <include>src/test/resources/*.yml</include>
                        </includes>
                        <jackson>
                            <features>
                                <ORDER_MAP_ENTRIES_BY_KEYS>true</ORDER_MAP_ENTRIES_BY_KEYS>
                            </features>
                            <yamlFeatures>
                                <WRITE_DOC_START_MARKER>false</WRITE_DOC_START_MARKER>
                            </yamlFeatures>
                        </jackson>
                    </yaml>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</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>${maven.compiler.java.version}</release>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <sourceFileExcludes>
                        <sourceFileExclude>**/KafkaError.java</sourceFileExclude>
                    </sourceFileExcludes>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <phase>verify</phase>
                    </execution>
                </executions>
            </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-no-fork</goal>
                        </goals>
                        <phase>verify</phase>
                    </execution>
                </executions>
            </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>
                <executions>
                    <execution>
                        <id>jacoco-initialize</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>

                    <execution>
                        <id>report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <phase>test</phase>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.sonarsource.scanner.maven</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>${sonar-maven-plugin.version}</version>
            </plugin>

            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>${central-publishing-maven-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>sign</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <phase>verify</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
