<?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>
    <groupId>ch.davidepedone</groupId>
    <artifactId>logback-kafka-appender</artifactId>
    <version>1.0.0</version>
    <name>Logback kafka appender</name>
    <description>Logback kafka appender</description>
    <url>https://github.com/davidepedone/logback-kafka-appender</url>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>

    </licenses>

    <properties>
        <!--General stuff-->
        <java.version>17</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
        <maven-release-plugin.version>3.3.1</maven-release-plugin.version>
        <maven-surefire-plugin.version>3.5.4</maven-surefire-plugin.version>
        <maven-publishing-plugin.version>0.9.0</maven-publishing-plugin.version>
        <maven-compiler-plugin.version>3.14.1</maven-compiler-plugin.version>
        <jacoco-maven-plugin.version>0.8.14</jacoco-maven-plugin.version>
        <spring-javaformat-maven-plugin.version>0.0.47</spring-javaformat-maven-plugin.version>
        <targetJdk>17</targetJdk>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
        <maven.compiler.source>${targetJdk}</maven.compiler.source>
        <maven.compiler.target>${targetJdk}</maven.compiler.target>
        <encoding>UTF-8</encoding>
        <slf4j.version>2.0.17</slf4j.version>
        <kafka.version>4.1.1</kafka.version>
        <logback.version>1.5.22</logback.version>
        <junit.version>6.0.1</junit.version>
        <hamcrest.version>3.0</hamcrest.version>
        <mockito.version>5.21.0</mockito.version>
        <sonar.organization>davidepedone</sonar.organization>
    </properties>

    <issueManagement>
        <url>https://github.com/davidepedone/logback-kafka-appender/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <scm>
        <connection>scm:git:git@github.com:davidepedone/logback-kafka-appender.git</connection>
        <developerConnection>scm:git:git@github.com:davidepedone/logback-kafka-appender.git</developerConnection>
        <url>git@github.com:davidepedone/logback-kafka-appender.git</url>
        <tag>v1.0.0</tag>
    </scm>

    <developers>
        <developer>
            <email>contact@davidepedone.ch</email>
            <name>Davide Pedone</name>
            <url>https://github.com/davidepedone</url>
            <id>davidepedone</id>
        </developer>
    </developers>

    <inceptionYear>2015</inceptionYear>


    <dependencies>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
            <version>${kafka.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-launcher</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-server-common</artifactId>
            <version>${kafka.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-test-common-runtime</artifactId>
            <version>${kafka.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>log4j-over-slf4j</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>${maven-compiler-plugin.version}</version>
                        <configuration>
                            <release>${targetJdk}</release>
                            <compilerArgs>
                                <arg>-Xlint:all</arg>
                                <arg>-proc:none</arg>
                                <!-- treat warnings as errors -->
                                <arg>-Werror</arg>
                            </compilerArgs>
                            <showWarnings>true</showWarnings>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven-surefire-plugin.version}</version>
                        <configuration>
                            <argLine>@{argLine} -javaagent:${org.mockito:mockito-core:jar}</argLine>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>properties</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>io.spring.javaformat</groupId>
                        <artifactId>spring-javaformat-maven-plugin</artifactId>
                        <version>${spring-javaformat-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>validate</phase>
                                <inherited>true</inherited>
                                <goals>
                                    <goal>validate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco-maven-plugin.version}</version>
                        <configuration>
                            <destFile>${basedir}/target/coverage-reports/jacoco-unit.exec</destFile>
                            <dataFile>${basedir}/target/coverage-reports/jacoco-unit.exec</dataFile>
                            <output>file</output>
                            <append>true</append>
                        </configuration>
                        <executions>
                            <execution>
                                <id>jacoco-initialize</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                                <phase>test-compile</phase>
                            </execution>
                            <execution>
                                <id>jacoco-site</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>${maven-publishing-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                        </configuration>
                    </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>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-release-plugin</artifactId>
                        <version>${maven-release-plugin.version}</version>
                        <configuration>
                            <tagNameFormat>v@{project.version}</tagNameFormat>
                            <autoVersionSubmodules>true</autoVersionSubmodules>
                            <useReleaseProfile>true</useReleaseProfile>
                            <goals>deploy</goals>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>

