<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>org.tkit.quarkus.lib</groupId>
    <artifactId>tkit-quarkus-parent</artifactId>
    <version>2.3.0</version>
    <name>tkit-quarkus-parent</name>
    <packaging>pom</packaging>

    <description>Tkit-Quarkus : Productivity extensions for Quarkus</description>
    <url>https://github.com/1000kit/tkit-quarkus</url>

    <organization>
        <name>tkit</name>
        <url>https://www.tkit.org</url>
    </organization>


    <developers>
        <developer>
            <id>tkit</id>
            <name>Tkit community</name>
            <organization>tkit</organization>
            <organizationUrl>https://www.tkit.org</organizationUrl>
        </developer>
    </developers>

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

    <scm>
        <connection>scm:git:git@github.com:1000kit/tkit-quarkus.git</connection>
        <developerConnection>scm:git:git@github.com:1000kit/tkit-quarkus.git</developerConnection>
        <url>https://github.com/1000kit/tkit-quarkus</url>
    </scm>

    <modules>
        <module>bom</module>
        <module>extensions</module>
        <module>it</module>
    </modules>

    <properties>
        <!-- Quarkus -->
        <quarkus.version>3.5.0</quarkus.version>
        <quarkus.hibernate-orm.version>6.3.1.Final</quarkus.hibernate-orm.version>
        <quarkiverse.mockserver.version>1.2.0</quarkiverse.mockserver.version>
        <quarkus.jandex-plugin.version>3.1.5</quarkus.jandex-plugin.version>

        <!-- build -->
        <format.skip>false</format.skip>
        <enforcer.skip>false</enforcer.skip>
        <enforce-test-deps-scope.skip>${enforcer.skip}</enforce-test-deps-scope.skip>

        <!-- Maven configuration -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <maven.compiler.release>17</maven.compiler.release>
        <maven.compiler.parameters>true</maven.compiler.parameters>
        <maven.compiler-plugin.version>3.11.0</maven.compiler-plugin.version>
        <maven.surefire-plugin.version>3.2.1</maven.surefire-plugin.version>
        <maven.formatter-maven-plugin.version>2.23.0</maven.formatter-maven-plugin.version>
        <maven.impsort-maven-plugin.version>1.9.0</maven.impsort-maven-plugin.version>
        <maven.enforcer-plugin.version>3.2.1</maven.enforcer-plugin.version>
        <maven.gpg-plugin.version>3.1.0</maven.gpg-plugin.version>
        <maven.source-plugin.version>3.3.0</maven.source-plugin.version>
        <maven.javadoc-plugin.version>3.6.0</maven.javadoc-plugin.version>
        <maven.nexus-staging-maven-plugin.version>1.6.13</maven.nexus-staging-maven-plugin.version>

        <!-- Other -->
        <dbunit.version>2.7.3</dbunit.version>
    </properties>


    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-bom</artifactId>
                <version>${quarkus.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.dbunit</groupId>
                <artifactId>dbunit</artifactId>
                <version>${dbunit.version}</version>
            </dependency>
            <dependency>
                <groupId>io.quarkiverse.mockserver</groupId>
                <artifactId>quarkus-mockserver</artifactId>
                <version>${quarkiverse.mockserver.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>io.quarkiverse.mockserver</groupId>
                <artifactId>quarkus-mockserver-test</artifactId>
                <version>${quarkiverse.mockserver.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compiler-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-extension-maven-plugin</artifactId>
                    <version>${quarkus.version}</version>
                </plugin>
                <plugin>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-maven-plugin</artifactId>
                    <version>${quarkus.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven.surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven.surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>io.smallrye</groupId>
                    <artifactId>jandex-maven-plugin</artifactId>
                    <version>${quarkus.jandex-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>make-index</id>
                            <goals>
                                <goal>jandex</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>${maven.formatter-maven-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <artifactId>quarkus-ide-config</artifactId>
                        <groupId>io.quarkus</groupId>
                        <version>${quarkus.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <!-- store outside of target to speed up formatting when mvn clean is used -->
                    <cachedir>.cache/formatter-maven-plugin-${maven.formatter-maven-plugin.version}</cachedir>
                    <configFile>eclipse-format.xml</configFile>
                    <lineEnding>LF</lineEnding>
                    <skip>${format.skip}</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.revelc.code</groupId>
                <artifactId>impsort-maven-plugin</artifactId>
                <version>${maven.impsort-maven-plugin.version}</version>
                <configuration>
                    <!-- store outside of target to speed up formatting when mvn clean is used -->
                    <cachedir>.cache/impsort-maven-plugin-${maven.impsort-maven-plugin.version}</cachedir>
                    <groups>java.,javax.,jakarta.,org.,com.</groups>
                    <staticGroups>*</staticGroups>
                    <skip>${format.skip}</skip>
                    <removeUnused>true</removeUnused>
                </configuration>
            </plugin>
        </plugins>
    </build>


    <profiles>
        <profile>
            <id>format</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <property>
                    <name>!no-format</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <version>${maven.formatter-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>format</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <version>${maven.impsort-maven-plugin.version}</version>
                        <configuration>
                            <removeUnused>true</removeUnused>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sort-imports</id>
                                <goals>
                                    <goal>sort</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>validate</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <property>
                    <name>no-format</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <version>${maven.formatter-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>validate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <version>${maven.impsort-maven-plugin.version}</version>
                        <configuration>
                            <removeUnused>true</removeUnused>
                        </configuration>
                        <executions>
                            <execution>
                                <id>check-imports</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>release</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${maven.nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <!-- To generate javadoc -->
                    <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>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven.javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</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>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

</project>
