<?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">
    <parent>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>46</version>
        <relativePath />
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <groupId>dev.resteasy.tools</groupId>
    <artifactId>resteasy-parent</artifactId>
    <version>3</version>
    <packaging>pom</packaging>

    <url>https://resteasy.dev</url>

    <scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
        <connection>scm:git:git://github.com/resteasy/resteasy-dev-tools.git</connection>
        <developerConnection>scm:git:git@github.com:resteasy/resteasy-dev-tools.git</developerConnection>
        <url>https://github.com/resteasy/resteasy-dev-tools/tree/main/</url>
        <tag>HEAD</tag>
    </scm>

    <developers>
        <developer>
            <name>James R. Perkins</name>
            <email>jperkins@redhat.com</email>
            <organization>Red Hat, Inc.</organization>
            <organizationUrl>https://redhat.com</organizationUrl>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>https://repository.jboss.org/licenses/apache-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <!-- Configuration properties -->
        <skipFormatting>false</skipFormatting>
        <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>

        <!-- Require a minimum of 17 to build with a release version of 11. -->
        <jdk.min.version>17</jdk.min.version>
        <maven.compiler.release>11</maven.compiler.release>

        <version.nexus.staging.maven.plugin>1.7.0</version.nexus.staging.maven.plugin>
        <version.formatter.maven.plugin>2.24.1</version.formatter.maven.plugin>
        <version.impsort.maven.plugin>1.11.0</version.impsort.maven.plugin>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <release>${maven.compiler.release}</release>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <configuration>
                        <configLocation>resteasy-checkstyle/checkstyle.xml</configLocation>
                        <consoleOutput>true</consoleOutput>
                        <failsOnError>true</failsOnError>
                        <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        <excludes>**/*$logger.java,**/*$bundle.java</excludes>
                        <useFile />
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>dev.resteasy.tools</groupId>
                            <artifactId>resteasy-checkstyle-config</artifactId>
                            <version>3</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <redirectTestOutputToFile>${maven.test.redirectTestOutputToFile}</redirectTestOutputToFile>
                    </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>
                        <skip>${skipFormatting}</skip>
                    </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>
                        <skip>${skipFormatting}</skip>
                        <removeUnused>true</removeUnused>
                    </configuration>
                    <executions>
                        <execution>
                            <id>sort-imports</id>
                            <goals>
                                <goal>sort</goal>
                            </goals>
                            <phase>process-sources</phase>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>maven-central-release</id>
            <activation>
                <property>
                    <name>maven.central.release</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${version.nexus.staging.maven.plugin}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <serverId>ossrh</serverId>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                            <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
                            <stagingProgressTimeoutMinutes>60</stagingProgressTimeoutMinutes>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>