<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2022, 2026 Contributors to the Eclipse Foundation
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  ~ 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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.eclipse.ee4j</groupId>
        <artifactId>project</artifactId>
        <version>2.0.6</version>
    </parent>

    <groupId>jakarta.json.bind</groupId>
    <artifactId>jakarta.json.bind-parent</artifactId>
    <version>3.1.0-M2</version>
    <packaging>pom</packaging>

    <name>Jakarta JSON Binding Parent</name>
    <description>Jakarta JSON Binding is a standard binding layer for converting Java objects to/from JSON documents.</description>
    <url>https://projects.eclipse.org/projects/ee4j.jsonb</url>

    <inceptionYear>2016</inceptionYear>

    <licenses>
        <license>
            <name>Eclipse Public License 2.0</name>
            <url>https://projects.eclipse.org/license/epl-2.0</url>
            <distribution>repo</distribution>
        </license>
        <license>
            <name>GNU General Public License, version 2 with the GNU Classpath Exception</name>
            <url>https://projects.eclipse.org/license/secondary-gpl-2.0-cp</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/jakartaee/jsonb-api.git</connection>
        <developerConnection>scm:git:git@github.com:jakartaee/jsonb-api.git</developerConnection>
        <url>https://github.com/jakartaee/jsonb-api</url>
        <tag>HEAD</tag>
    </scm>

    <issueManagement>
        <system>github</system>
        <url>https://github.com/jakartaee/jsonb-api/issues</url>
    </issueManagement>

    <developers>
        <developer>
            <name>Jakarta JSON Binding Developers</name>
            <email>jsonb-dev@eclipse.org</email>
            <organization>Eclipse Jakarta Binding Working Group</organization>
            <organizationUrl>https://projects.eclipse.org/projects/ee4j.jsonb/who</organizationUrl>
        </developer>
    </developers>

    <mailingLists>
        <mailingList>
            <name>Jakarta JSON Binding Developers</name>
            <subscribe>https://accounts.eclipse.org/mailing-list/jsonb-dev</subscribe>
            <unsubscribe>https://accounts.eclipse.org/mailing-list/jsonb-dev</unsubscribe>
            <archive>https://www.eclipse.org/lists/jsonb-dev</archive>
            <post>jsonb-dev@eclipse.org</post>
        </mailingList>
    </mailingLists>

    <properties>
        <!-- Project settings -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.release>17</maven.compiler.release>

        <!-- Required by org.eclipse.ee4j:project parent POM for Nexus staging deployment -->
        <nexus.staging.repository>jsonb-maven2-staging</nexus.staging.repository>

        <!-- Timestamp used as the spec document revision date (e.g. "March 15, 2026") -->
        <maven.build.timestamp.format>MMMM dd, yyyy</maven.build.timestamp.format>
        <revisiondate>${maven.build.timestamp}</revisiondate>

        <!-- Plugin versions -->
        <build.helper.maven.plugin.version>3.6.2</build.helper.maven.plugin.version>
        <buildnumber.maven.plugin.version>3.3.1</buildnumber.maven.plugin.version>
        <checkstyle.version>12.3.1</checkstyle.version>
        <exec.maven.plugin.version>3.6.4</exec.maven.plugin.version>
        <glassfish.copyright.plugin.version>2.4</glassfish.copyright.plugin.version>
        <maven.assembly.plugin.version>3.8.0</maven.assembly.plugin.version>
        <maven.antrun.plugin.version>3.2.0</maven.antrun.plugin.version>
        <maven.bundle.plugin.version>6.2.0</maven.bundle.plugin.version>
        <maven.checkstyle.plugin.version>3.6.0</maven.checkstyle.plugin.version>
        <maven.compiler.plugin.version>3.16.0</maven.compiler.plugin.version>
        <maven.dependency.plugin.version>3.11.0</maven.dependency.plugin.version>
        <maven.deploy.plugin.version>3.2.0</maven.deploy.plugin.version>
        <maven.enforcer.plugin.version>3.6.3</maven.enforcer.plugin.version>
        <maven.gpg.plugin.version>3.2.8</maven.gpg.plugin.version>
        <maven.jar.plugin.version>3.5.1</maven.jar.plugin.version>
        <maven.javadoc.plugin.version>3.12.0</maven.javadoc.plugin.version>
        <maven.jxr.plugin.version>3.6.0</maven.jxr.plugin.version>
        <maven.release.plugin.version>3.3.1</maven.release.plugin.version>
        <maven.source.plugin.version>3.4.0</maven.source.plugin.version>
        <maven.surefire.plugin.version>3.6.0</maven.surefire.plugin.version>
        <maven.surefire.report.plugin.version>3.5.3</maven.surefire.report.plugin.version>
        <spec.version.maven.plugin.version>2.2</spec.version.maven.plugin.version>
        <sigtest.maven.version>2.7</sigtest.maven.version>
        <spotbugs.maven.plugin.version>4.10.4.1</spotbugs.maven.plugin.version>

        <!-- Asciidoctor plugin and its runtime classpath dependencies (jruby + asciidoctorj are
             injected as plugin deps, not project deps, so they do not appear in the compile classpath) -->
        <asciidoctorj.version>3.0.1</asciidoctorj.version>
        <asciidoctorj.pdf.version>2.3.27</asciidoctorj.pdf.version>
        <asciidoctor.maven.plugin.version>3.2.0</asciidoctor.maven.plugin.version>
        <jruby.version>9.4.12.1</jruby.version>

        <!-- Dependency versions -->
        <jakarta.json.version>2.1.3</jakarta.json.version>
        <jakarta.inject.version>2.0.1</jakarta.inject.version>
        <jakarta.enterprise.cdi.version>5.0.0</jakarta.enterprise.cdi.version>
        <junit.jupiter.version>6.1.3</junit.jupiter.version>
        <hamcrest.version>3.0</hamcrest.version>

    </properties>

    <!-- Central version management: declare versions here, omit <version> in child module <dependencies> -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>jakarta.json</groupId>
                <artifactId>jakarta.json-api</artifactId>
                <version>${jakarta.json.version}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.json.bind</groupId>
                <artifactId>jakarta.json.bind-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.inject</groupId>
                <artifactId>jakarta.inject-api</artifactId>
                <version>${jakarta.inject.version}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.enterprise</groupId>
                <artifactId>jakarta.enterprise.cdi-api</artifactId>
                <version>${jakarta.enterprise.cdi.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit.jupiter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit.jupiter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest</artifactId>
                <version>${hamcrest.version}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.tck</groupId>
                <artifactId>sigtest-maven-plugin</artifactId>
                <version>${sigtest.maven.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <!-- Central plugin version management: declare versions here, omit <version> in child module <build><plugins> -->
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${build.helper.maven.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven.assembly.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>${maven.antrun.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>${maven.bundle.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${maven.checkstyle.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compiler.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven.dependency.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven.deploy.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${maven.enforcer.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven.gpg.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven.jar.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven.javadoc.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jxr-plugin</artifactId>
                    <version>${maven.jxr.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven.release.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven.source.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>org.codehaus.mojo</groupId>
                    <artifactId>buildnumber-maven-plugin</artifactId>
                    <version>${buildnumber.maven.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${exec.maven.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.glassfish.build</groupId>
                    <artifactId>spec-version-maven-plugin</artifactId>
                    <version>${spec.version.maven.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.glassfish.copyright</groupId>
                    <artifactId>glassfish-copyright-maven-plugin</artifactId>
                    <version>${glassfish.copyright.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>${spotbugs.maven.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.asciidoctor</groupId>
                    <artifactId>asciidoctor-maven-plugin</artifactId>
                    <version>${asciidoctor.maven.plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!-- Ensure contributor is using the correct JDK before attempting to build the project -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-versions</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>[${maven.compiler.release},)</version>
                                    <message>You need JDK ${maven.compiler.release} or newer</message>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Parse the version number to determine the spec version, minor version, and document mark (DRAFT/FINAL) -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <!-- 1. Parse spec.version (Takes the first two parts, e.g., 3.0 from 3.0.0-SNAPSHOT) -->
                    <execution>
                        <id>parse-spec-version</id>
                        <goals>
                            <goal>regex-property</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <name>spec.version</name>
                            <value>${project.version}</value>
                            <!-- Matches major.minor and captures it -->
                            <regex>^([0-9]+\.[0-9]+)\..*</regex>
                            <replacement>$1</replacement>
                            <failIfNoMatch>true</failIfNoMatch>
                        </configuration>
                    </execution>

                    <!-- 2. Parse bundle.version (Takes the first three parts, e.g., 3.0.1 from 3.0.1-M1) -->
                    <execution>
                        <id>parse-bundle-version</id>
                        <goals>
                            <goal>regex-property</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <name>bundle.version</name>
                            <value>${project.version}</value>
                            <!-- Matches major.minor.micro and captures it -->
                            <regex>^([0-9]+\.[0-9]+\.[0-9]+).*</regex>
                            <replacement>$1</replacement>
                            <failIfNoMatch>true</failIfNoMatch>
                        </configuration>
                    </execution>

                    <!-- 3. Parse doc.mark for DRAFT versions (-SNAPSHOT, -M*, -RC*) -->
                    <execution>
                        <id>parse-doc-mark-draft</id>
                        <goals>
                            <goal>regex-property</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <name>doc.mark</name>
                            <value>${project.version}</value>
                            <!-- Matches if version contains -SNAPSHOT, -M, or -RC -->
                            <regex>.*-(SNAPSHOT|M[0-9]+|RC[0-9]+).*</regex>
                            <replacement>DRAFT</replacement>
                            <failIfNoMatch>false</failIfNoMatch>
                        </configuration>
                    </execution>

                    <!-- 4. Parse doc.mark for FINAL versions (Fallback if no DRAFT suffix matches) -->
                    <execution>
                        <id>parse-doc-mark-final</id>
                        <goals>
                            <goal>regex-property</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <name>doc.mark</name>
                            <value>${doc.mark}</value>
                            <regex>^(?!DRAFT$).*$</regex>
                            <replacement>FINAL</replacement>
                            <failIfNoMatch>false</failIfNoMatch>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <modules>
        <module>api</module>
        <module>docs</module>
        <module>spec</module>
        <module>tck</module>
        <module>tck-dist</module>
    </modules>

</project>