<?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.phoeniqs.oss</groupId>
    <artifactId>quarkus-commons</artifactId>
    <version>2.0.3-SNAPSHOT</version>
    <packaging>pom</packaging>

    <modules>
        <module>quarkus-audit-tools</module>
        <module>quarkus-client-logger</module>
        <module>quarkus-clock-service</module>
        <module>quarkus-forgejo-client</module>
        <module>quarkus-json-service</module>
        <module>quarkus-litellm-client</module>
        <module>quarkus-message-digest-service</module>
        <module>quarkus-random-number-generator</module>
        <module>quarkus-table-generator</module>
        <module>quarkus-tracing-service</module>
        <module>quarkus-uuid-generator</module>
    </modules>

    <properties>
        <!-- Quarkus properties -->
        <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
        <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
        <quarkus.platform.version>3.34.3</quarkus.platform.version>

        <!-- Plugin versions -->
        <compiler-plugin.version>3.15.0</compiler-plugin.version>
        <surefire-plugin.version>3.5.5</surefire-plugin.version>
        <spotless-plugin.version>3.4.0</spotless-plugin.version>
        <palantir-java-format.version>2.72.0</palantir-java-format.version>
        <jacoco-plugin.version>0.8.14</jacoco-plugin.version> <!-- Match with version from Quarkus BOM -->
        <jandex-plugin.version>3.5.3</jandex-plugin.version>
        <release-plugin.version>3.3.1</release-plugin.version>
        <source-plugin.version>3.4.0</source-plugin.version>

        <!-- Build properties -->
        <maven.compiler.release>21</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <skipITs>true</skipITs>

        <!-- Dependencies -->
        <java-uuid-generator.version>5.2.0</java-uuid-generator.version>
        <quarkus-jgit.version>3.6.2</quarkus-jgit.version>

        <!-- Test dependencies -->
        <assertj-core.version>3.27.7</assertj-core.version>
    </properties>

    <distributionManagement>
        <repository>
            <id>phoenix-oss</id>
            <url>https://git.kvant.cloud/api/packages/phoenix-oss/maven</url>
        </repository>
        <snapshotRepository>
            <id>phoenix-oss</id>
            <url>https://git.kvant.cloud/api/packages/phoenix-oss/maven</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>${quarkus.platform.artifact-id}</artifactId>
                <version>${quarkus.platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <scm>
        <connection>scm:git:ssh://git@git-ssh.kvant.cloud:2222/phoenix-oss/quarkus-commons.git</connection>
        <developerConnection>scm:git:ssh://git@git-ssh.kvant.cloud:2222/phoenix-oss/quarkus-commons.git</developerConnection>
        <url>https://git.kvant.cloud/phoenix-oss/quarkus-commons.git</url>
        <tag>HEAD</tag>
    </scm>

    <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-arc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-cyclonedx</artifactId>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj-core.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit-mockito</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-jacoco</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <version>${quarkus.platform.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                            <goal>generate-code</goal>
                            <goal>generate-code-tests</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler-plugin.version}</version>
                <configuration>
                    <compilerArgs>
                        <arg>-parameters</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire-plugin.version}</version>
                <configuration>
                    <systemPropertyVariables>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                        <!--suppress UnresolvedMavenProperty -->
                        <maven.home>${maven.home}</maven.home>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${spotless-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>compile</phase>
                    </execution>
                </executions>
                <configuration>
                    <java>
                        <removeUnusedImports />
                        <palantirJavaFormat>
                            <version>${palantir-java-format.version}</version>
                            <style>PALANTIR</style>
                            <formatJavadoc>false</formatJavadoc>
                        </palantirJavaFormat>
                    </java>
                </configuration>
            </plugin>
            <plugin>
                <groupId>io.smallrye</groupId>
                <artifactId>jandex-maven-plugin</artifactId>
                <version>${jandex-plugin.version}</version>
                <executions>
                    <execution>
                        <id>make-index</id>
                        <goals>
                            <goal>jandex</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${release-plugin.version}</version>
                <configuration>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                    <checkModificationExcludes>mvnw</checkModificationExcludes>
                    <scmReleaseCommitComment>chore: release @{releaseLabel}</scmReleaseCommitComment>
                    <scmDevelopmentCommitComment>chore: prepare for next development iteration</scmDevelopmentCommitComment>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
