<!--
  ~ Copyright The RESTEasy Authors
  ~ SPDX-License-Identifier: Apache-2.0
  -->

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>54</version>
        <relativePath />
    </parent>

    <groupId>dev.resteasy.providers</groupId>
    <artifactId>resteasy-jackson-provider-parent</artifactId>
    <version>1.0.0.Final</version>
    <packaging>pom</packaging>
    <name>RESTEasy Jackson Provider - Parent</name>
    <description>A Jakarta REST provider for Jackson with RESTEasy</description>

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

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

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

    <developers>
        <developer>
            <id>jamezp</id>
            <name>James R Perkins</name>
            <email>jperkins@ibm.com</email>
            <organization>IBM</organization>
            <organizationUrl>https://resteasy.dev</organizationUrl>
        </developer>
    </developers>

    <modules>
        <module>provider</module>
        <module>docs</module>
    </modules>

    <scm>
        <connection>scm:git:git://github.com/resteasy/resteasy-jackson-provider.git</connection>
        <developerConnection>scm:git:git@github.com:resteasy/resteasy-jackson-provider.git</developerConnection>
        <url>https://github.com/resteasy/resteasy-jackson-provider</url>
        <tag>v1.0.0.Final</tag>
    </scm>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/resteasy/resteasy-jackson-provider/issues</url>
    </issueManagement>

    <properties>
        <!-- Compile to Java SE 17 -->
        <maven.compiler.release>17</maven.compiler.release>

        <!-- Plugin versions -->
        <version.spotless-maven-plugin>3.10.3</version.spotless-maven-plugin>

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

        <!-- 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.deploymentName>resteasy-jackson-provider-${project.version}</central.deploymentName>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${version.spotless-maven-plugin}</version>
                <dependencies>
                    <dependency>
                        <groupId>dev.resteasy.tools</groupId>
                        <artifactId>ide-config</artifactId>
                        <version>4</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <skip>${skipFormatting}</skip>
                    <upToDateChecking>
                        <enabled>true</enabled>
                        <indexFile>${project.basedir}/.cache/spotless-index-${version.spotless-maven-plugin}</indexFile>
                    </upToDateChecking>
                    <java>
                        <eclipse>
                            <file>eclipse-code-formatter.xml</file>
                        </eclipse>
                        <importOrder>
                            <order>\#,java,javax,jakarta,org,io,dev,com,net</order>
                        </importOrder>
                        <removeUnusedImports>
                            <!-- default one fails to process the classes -->
                            <engine>cleanthat-javaparser-unnecessaryimport</engine>
                        </removeUnusedImports>
                        <forbidWildcardImports />
                        <trimTrailingWhitespace />
                        <endWithNewline />
                        <licenseHeader>
                            <file>license-java-asl-header</file>
                            <!-- Delimiter is a regex which identifies the "top" of the file i.e. all above it is considered a header -->
                            <delimiter>(\n)*^(\/\/tag.+|\/\/spotless.+|package .+;|module .+;|\/\/.+|\/\*\*.*)$</delimiter>
                        </licenseHeader>
                        <replaceRegex>
                            <name>Remove wildcard imports</name>
                            <searchRegex>^import\s+[^\*\s]+\*;$</searchRegex>
                            <replacement>$1</replacement>
                        </replaceRegex>
                    </java>
                    <formats>
                        <format>
                            <includes>
                                <include>pom.xml</include>
                                <include>src/**/*.xml</include>
                            </includes>
                            <trimTrailingWhitespace />
                            <endWithNewline />
                            <licenseHeader>
                                <file>license-xml-asl-header</file>
                                <!-- Delimiter is a regex which identifies the "top" of the file i.e. all above it is considered a header -->
                                <delimiter><![CDATA[(\n)*^(<[^!?]+|<!DOCTYPE.+)$]]></delimiter>
                                <skipLinesMatching><![CDATA[<\?xml.+\?>]]></skipLinesMatching>
                            </licenseHeader>
                            <indent>
                                <spaces>true</spaces>
                                <spacesPerTab>4</spacesPerTab>
                            </indent>
                        </format>
                    </formats>
                    <asciidoc>
                        <includes>
                            <include>**/*.adoc</include>
                        </includes>

                        <adocfmt>
                            <normalizeListBullets>true</normalizeListBullets>
                            <normalizeOrderedListMarkers>true</normalizeOrderedListMarkers>
                            <ensureSourceDelimiters>true</ensureSourceDelimiters>
                        </adocfmt>
                    </asciidoc>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>apply</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>format-check</id>
            <build>
                <plugins>
                    <!-- Validate formatting -->
                    <plugin>
                        <groupId>com.diffplug.spotless</groupId>
                        <artifactId>spotless-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>validate-format</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
