<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/maven-v4_0_0.xsd">

    <parent>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>53</version>
        <relativePath />
    </parent>

    <modelVersion>4.0.0</modelVersion>

    <name>RESTEasy Extensions</name>
    <description>RESTEasy Extensions and Utilities</description>
    <url>https://resteasy.dev</url>

    <groupId>org.jboss.resteasy</groupId>
    <artifactId>resteasy-extensions</artifactId>
    <version>2.0.2.Final</version>
    <packaging>pom</packaging>

    <organization>
        <name>RESTEasy Community</name>
        <url>https://resteasy.dev</url>
    </organization>

    <licenses>
        <license>
            <name>Eclipse Public License 2.0</name>
            <url>https://www.eclipse.org/legal/epl-v20.html</url>
            <distribution>repo</distribution>
        </license>
        <license>
            <name>GNU General Public License, Version 2 with the Classpath Exception</name>
            <url>https://repository.jboss.org/licenses/gpl-2.0-ce.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/resteasy/resteasy-extensions.git</connection>
        <developerConnection>scm:git:git@github.com:resteasy/resteasy-extensions.git</developerConnection>
        <url>https://github.com/resteasy/resteasy-extensions/</url>
        <tag>v2.0.2.Final</tag>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/resteasy/resteasy-extensions/issues</url>
    </issueManagement>

    <properties>

        <maven.compiler.release>11</maven.compiler.release>

        <!-- print logs to file by default -->
        <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
        <!-- Dependency versions, please keep in alphabetical order -->
        <version.jakarta.ws.rs-api>3.1.0</version.jakarta.ws.rs-api>
        <version.org.jboss.logging.jboss-logging>3.6.3.Final</version.org.jboss.logging.jboss-logging>
        <version.org.jboss.logging.jboss-logging-tools>3.0.4.Final</version.org.jboss.logging.jboss-logging-tools>
        <version.org.jboss.resteasy>6.2.16.Final</version.org.jboss.resteasy>
        <version.org.junit>5.13.4</version.org.junit>
        <version.org.kohsuke.metainf-services>1.11</version.org.kohsuke.metainf-services>

        <!-- Plugin versions -->
        <version.formatter.maven.plugin>2.29.0</version.formatter.maven.plugin>
        <version.impsort.maven.plugin>1.13.0</version.impsort.maven.plugin>

        <!-- maven-release-plugin configuration -->
        <autoVersionSubmodules>true</autoVersionSubmodules>
        <releaseProfiles>central-release</releaseProfiles>
        <signTag>true</signTag>
        <tagNameFormat>v@{project.version}</tagNameFormat>
        <arguments>-DskipTests -DpushChanges=${pushChanges} -Dcentral.autoPublish=${central.autoPublish}</arguments>
        <!-- Do not push changes by default when using the maven-release-plugin:prepare -->
        <pushChanges>false</pushChanges>
        <!-- Use the local directory when using perform -->
        <localCheckout>true</localCheckout>
        <!-- Maven Central properties -->
        <central.sonatype.url>https://central.sonatype.com</central.sonatype.url>
        <central.serverId>central</central.serverId>
        <central.deploymentName>${project.artifactId}-${project.version}</central.deploymentName>
        <central.autoPublish>true</central.autoPublish>
        <central.waitUntil>validated</central.waitUntil>
        <central.skipPublishing>false</central.skipPublishing>
    </properties>

    <modules>
        <module>tracing</module>
        <module>eagledns</module>
        <module>cache</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <!-- BOM Imports -->
            <dependency>
                <groupId>org.jboss.resteasy</groupId>
                <artifactId>resteasy-bom</artifactId>
                <version>${version.org.jboss.resteasy}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${version.org.junit}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- Jakarta Dependencies -->
            <dependency>
                <groupId>jakarta.ws.rs</groupId>
                <artifactId>jakarta.ws.rs-api</artifactId>
                <version>${version.jakarta.ws.rs-api}</version>
            </dependency>

            <dependency>
                <groupId>org.jboss.logging</groupId>
                <artifactId>jboss-logging</artifactId>
                <version>${version.org.jboss.logging.jboss-logging}</version>
            </dependency>

            <dependency>
                <groupId>org.jboss.logging</groupId>
                <artifactId>jboss-logging-annotations</artifactId>
                <version>${version.org.jboss.logging.jboss-logging-tools}</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>

            <dependency>
                <groupId>org.jboss.logging</groupId>
                <artifactId>jboss-logging-processor</artifactId>
                <version>${version.org.jboss.logging.jboss-logging-tools}</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>org.kohsuke.metainf-services</groupId>
                <artifactId>metainf-services</artifactId>
                <version>${version.org.kohsuke.metainf-services}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>


    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <configuration>
                        <excludePackageNames>
                            com.restfully.*:org.jboss.resteasy.examples.*:org.jboss.resteasy.tests.*
                        </excludePackageNames>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <version>${version.formatter.maven.plugin}</version>
                    <dependencies>
                        <dependency>
                            <groupId>dev.resteasy.tools</groupId>
                            <artifactId>ide-config</artifactId>
                            <version>3</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <!-- store outside of target to speed up formatting when mvn clean is used -->
                        <cachedir>.cache</cachedir>
                        <configFile>eclipse-code-formatter.xml</configFile>
                        <configXmlFile>resteasy-xml.properties</configXmlFile>
                        <includeResources>true</includeResources>
                        <lineEnding>LF</lineEnding>
                        <removeTrailingWhitespace>true</removeTrailingWhitespace>
                    </configuration>
                    <executions>
                        <execution>
                            <id>format</id>
                            <goals>
                                <goal>format</goal>
                            </goals>
                            <phase>process-sources</phase>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code</groupId>
                    <artifactId>impsort-maven-plugin</artifactId>
                    <version>${version.impsort.maven.plugin}</version>
                    <configuration>
                        <!-- store outside of target to speed up formatting when mvn clean is used -->
                        <cachedir>.cache</cachedir>
                        <groups>java.,javax.,jakarta.,org.,com.</groups>
                        <staticGroups>*</staticGroups>
                        <removeUnused>true</removeUnused>
                    </configuration>
                    <executions>
                        <execution>
                            <id>sort-resource-imports</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>sort</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.jboss.logging</groupId>
                            <artifactId>jboss-logging-processor</artifactId>
                            <version>${version.org.jboss.logging.jboss-logging-tools}</version>
                        </path>
                        <path>
                            <groupId>org.kohsuke.metainf-services</groupId>
                            <artifactId>metainf-services</artifactId>
                            <version>${version.org.kohsuke.metainf-services}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <executions>
                    <execution>
                        <id>check-style</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>checkstyle</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Format source files -->
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>net.revelc.code</groupId>
                <artifactId>impsort-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>format-check</id>
            <build>
                <plugins>
                    <!-- Validate formatting -->
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>validate-format</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>validate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>check-import-sort</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
