<?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>codes.thischwa</groupId>
    <artifactId>cloudflaredns</artifactId>
    <version>0.5.0-SNAPSHOT</version>
    <name>CloudflareDNS-java</name>
    <inceptionYear>2025</inceptionYear>
    <packaging>jar</packaging>

    <issueManagement>
        <url>https://git.mein-gateway.de/thischwa/CloudflareDNS-java/issues</url>
        <system>Gitea Issues</system>
    </issueManagement>

    <properties>
        <java.version>17</java.version>
        <file.encoding>UTF-8</file.encoding>
        <project.build.sourceEncoding>${file.encoding}</project.build.sourceEncoding>
        <project.reporting.outputEncoding>${file.encoding}</project.reporting.outputEncoding>

        <!-- checkstyle -->
        <checkstyle.version>12.3.0</checkstyle.version>
        <checkstyle.plugin.version>3.6.0</checkstyle.plugin.version>
        <checkstyle.config.location>${project.basedir}/src/checkstyle/google_custom_checks.xml
        </checkstyle.config.location>
        <checkstyle.includeTestResources>false</checkstyle.includeTestResources>
        <checkstyle.violationSeverity>warning</checkstyle.violationSeverity>
        <checkstyle.failOnViolation>false</checkstyle.failOnViolation>
        <checkstyle.propertyExpansion>config_loc=${basedir}
        </checkstyle.propertyExpansion>
        <checkstyle.consoleOutput>true</checkstyle.consoleOutput>
        <linkXRef>false</linkXRef>

        <!-- 3rd party dependencies -->
        <jackson.version>2.21.1</jackson.version>
        <httpclient5.version>5.5.1</httpclient5.version>
        <lombok.version>1.18.36</lombok.version>
        <slf4j.version>2.0.17</slf4j.version>
        <logback-classic.version>1.5.25</logback-classic.version>
        <junit5.version>5.14.2</junit5.version>
        <mockito-junit5.version>5.21.0</mockito-junit5.version>

        <!-- sonarqube -->
        <sonar.organization>th-schwarz</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        <sonar.sourceEncoding>${file.encoding}</sonar.sourceEncoding>
        <sonar.projectKey>th-schwarz_CloudflareDNS-java</sonar.projectKey>
        <sonar.projectName>CloudflareDNS-java</sonar.projectName>
        <sonar.branch.name>develop</sonar.branch.name>
        <sonar.test.exclusions>src/test/java/**/*</sonar.test.exclusions>

        <lombok-maven-plugin.version>1.18.20.0</lombok-maven-plugin.version>
    </properties>

    <scm>
        <developerConnection>scm:git:https://git.mein-gateway.de/thischwa/CloudflareDNS-java.git</developerConnection>
        <connection>scm:git:https://git.mein-gateway.de/thischwa/CloudflareDNS-java.git</connection>
        <url>https://git.mein-gateway.de/thischwa/CloudflareDNS-java</url>
        <tag>HEAD</tag>
    </scm>

    <distributionManagement>
        <repository>
            <id>mygitea</id>
            <url>https://git.mein-gateway.de/api/packages/thischwa/maven</url>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
        <snapshotRepository>
            <id>mygitea</id>
            <url>https://git.mein-gateway.de/api/packages/thischwa/maven</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </snapshotRepository>
    </distributionManagement>

    <dependencies>
        <dependency>
            <groupId>org.apache.httpcomponents.client5</groupId>
            <artifactId>httpclient5</artifactId>
            <version>${httpclient5.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>24.0.0</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit5.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${mockito-junit5.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback-classic.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.11.2</version>
                <configuration>
                    <failOnError>false</failOnError>
                    <failOnWarnings>false</failOnWarnings>
                    <locale>en</locale>
                    <source>${java.version}</source>
                </configuration>
                <executions>
                    <execution>
                        <id>build javadoc jar</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.3.1</version>
                <configuration>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <arguments>-DskipTests</arguments>
                </configuration>
            </plugin>

            <plugin>
                <!-- checkstyle -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${checkstyle.plugin.version}</version>
                <executions>
                    <execution>
                        <id>checkstyle-validate</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${checkstyle.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <!-- generates the code coverage report for sonar cube -->
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.13</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report-code-coverage</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <formats>XML</formats>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <!-- to export test summary -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.5.3</version>
            </plugin>

            <plugin>
                <!-- workaround for Gitea Maven package registry SNAPSHOT deploy issue with plugin 3.x -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
            </plugin>

            <plugin>
                <!-- delombok -->
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok-maven-plugin</artifactId>
                <version>${lombok-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>delombok-sources</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>delombok</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <sourceDirectory>src/main/java</sourceDirectory>
                    <outputDirectory>${project.build.directory}/delombok</outputDirectory>
                    <addOutputDirectory>false</addOutputDirectory>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.projectlombok</groupId>
                        <artifactId>lombok</artifactId>
                        <version>${lombok.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.4.2</version>
                <executions>
                    <execution>
                        <id>attach-delomboked-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classesDirectory>${project.build.directory}/delombok</classesDirectory>
                            <classifier>sources</classifier>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
