<!--
  ~ 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>53</version>
        <relativePath />
    </parent>

    <groupId>dev.resteasy.providers</groupId>
    <artifactId>resteasy-jackson-provider</artifactId>
    <version>1.0.0.Alpha1</version>
    <packaging>jar</packaging>
    <name>RESTEasy Jackson Provider</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>

    <scm>
        <connection>scm:git:git://git@github.com:resteasy/resteasy-jackson-provider.git</connection>
        <developerConnection>scm:git:git://git@github.com:resteasy/resteasy-jackson-provider.git</developerConnection>
        <url>git://github.com/resteasy/resteasy-jackson-provider.git</url>
        <tag>v1.0.0.Alpha1</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>

        <!-- Dependency Versions, keep in alphabetical order -->
        <version.jakarta.ee>10.0.0</version.jakarta.ee>
        <version.org.jboss.logging>3.6.3.Final</version.org.jboss.logging>
        <version.org.jboss.logging.jboss-logging-tools>3.0.4.Final</version.org.jboss.logging.jboss-logging-tools>
        <version.org.jboss.logmanager>3.2.2.Final</version.org.jboss.logmanager>
        <version.org.jboss.resteasy>6.2.16.Final</version.org.jboss.resteasy>
        <version.org.jboss.resteasy.extensions>2.0.2.Final</version.org.jboss.resteasy.extensions>
        <version.org.jboss.resteasy.junit>1.0.0.Beta4</version.org.jboss.resteasy.junit>
        <version.org.junit>6.1.1</version.org.junit>
        <version.tools.jackson>3.1.4</version.tools.jackson>

        <!-- Plugin versions -->
        <version.spotless-maven-plugin>3.8.0</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>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>jakarta.platform</groupId>
                <artifactId>jakarta.jakartaee-bom</artifactId>
                <version>${version.jakarta.ee}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <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>tools.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${version.tools.jackson}</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>
            <dependency>
                <groupId>org.jboss.logging</groupId>
                <artifactId>jboss-logging</artifactId>
                <version>${version.org.jboss.logging}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-core-spi</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-core</artifactId>
        </dependency>
        <dependency>
            <groupId>tools.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>tools.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>tools.jackson.jakarta.rs</groupId>
            <artifactId>jackson-jakarta-rs-base</artifactId>
        </dependency>
        <dependency>
            <groupId>tools.jackson.jakarta.rs</groupId>
            <artifactId>jackson-jakarta-rs-json-provider</artifactId>
        </dependency>
        <dependency>
            <groupId>tools.jackson.module</groupId>
            <artifactId>jackson-module-jakarta-xmlbind-annotations</artifactId>
        </dependency>

        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging-annotations</artifactId>
            <version>${version.org.jboss.logging.jboss-logging-tools}</version>
            <!-- This is a compile time only requirement -->
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-tracing-api</artifactId>
            <version>${version.org.jboss.resteasy.extensions}</version>
            <optional>true</optional>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>dev.resteasy.junit.extension</groupId>
            <artifactId>resteasy-junit-extension</artifactId>
            <version>${version.org.jboss.resteasy.junit}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.logmanager</groupId>
            <artifactId>jboss-logmanager</artifactId>
            <version>${version.org.jboss.logmanager}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-client</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-undertow-cdi</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <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>
                    </annotationProcessorPaths>
                    <compilerArgs>
                        <!-- Do not add the @Generated annotation to the generated logging source files to avoid
                             requiring the java.compiler module dependency.
                         -->
                        <arg>-Aorg.jboss.logging.tools.addGeneratedAnnotation=false</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <systemPropertyVariables>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <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>
