<?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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.hyperfoil.tools</groupId>
    <artifactId>jjq-parent</artifactId>
    <version>0.2.2</version>
    <packaging>pom</packaging>

    <name>jjq</name>
    <description>High-performance Java jq implementation backed by fastjson2</description>
    <url>https://github.com/Hyperfoil/jjq</url>

    <scm>
        <connection>scm:git:https://github.com/Hyperfoil/jjq.git</connection>
        <developerConnection>scm:git:https://github.com/Hyperfoil/jjq.git</developerConnection>
        <url>https://github.com/Hyperfoil/jjq</url>
        <tag>0.2.2</tag>
    </scm>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <distributionManagement>
        <repository>
            <id>central</id>
            <url>https://central.sonatype.com/artifact</url>
        </repository>
    </distributionManagement>

    <developers>
        <developer>
            <name>Ståle Pedersen</name>
            <email>spederse@redhat.com</email>
            <organization>Red Hat</organization>
            <organizationUrl>https://www.redhat.com</organizationUrl>
        </developer>
    </developers>

    <modules>
        <module>jjq-core</module>
        <module>jjq-fastjson2</module>
        <module>jjq-cli</module>
        <module>jjq-test-suite</module>
        <module>jjq-jackson</module>
        <module>jjq-jakarta</module>
        <module>jjq-jsonata</module>
        <module>jjq-jsonpath</module>
        <module>jjq-mapper</module>
        <module>jjq-mapper-processor</module>
        <module>jjq-mapper-jackson</module>
        <module>jjq-mapper-jsonb</module>
        <module>jjq-yaml</module>
    </modules>

    <properties>
        <maven.compiler.release>21</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <fastjson2.version>2.0.53</fastjson2.version>
        <jackson.version>2.18.2</jackson.version>
        <jakarta.json.bind.version>3.0.1</jakarta.json.bind.version>
        <snakeyaml.version>2.6</snakeyaml.version>
        <aesh.version>2.7</aesh.version>
        <junit.version>5.11.3</junit.version>
        <version.sonatype.central>0.11.0</version.sonatype.central>
        <version.maven.source>3.3.1</version.maven.source>
        <version.maven.javadoc>3.11.2</version.maven.javadoc>
        <version.maven.gpg>3.2.7</version.maven.gpg>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.hyperfoil.tools</groupId>
                <artifactId>jjq-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.hyperfoil.tools</groupId>
                <artifactId>jjq-fastjson2</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.hyperfoil.tools</groupId>
                <artifactId>jjq-jackson</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.hyperfoil.tools</groupId>
                <artifactId>jjq-jakarta</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.hyperfoil.tools</groupId>
                <artifactId>jjq-mapper</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.hyperfoil.tools</groupId>
                <artifactId>jjq-mapper-processor</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.hyperfoil.tools</groupId>
                <artifactId>jjq-mapper-jackson</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.hyperfoil.tools</groupId>
                <artifactId>jjq-mapper-jsonb</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.hyperfoil.tools</groupId>
                <artifactId>jjq-yaml</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.json.bind</groupId>
                <artifactId>jakarta.json.bind-api</artifactId>
                <version>${jakarta.json.bind.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.fastjson2</groupId>
                <artifactId>fastjson2</artifactId>
                <version>${fastjson2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.aesh</groupId>
                <artifactId>aesh</artifactId>
                <version>${aesh.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.13.0</version>
                    <configuration>
                        <release>22</release>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.5.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${version.maven.javadoc}</version>
                    <configuration>
                        <release>22</release>
                        <!-- Suppress missing-javadoc warnings for internal/engine code.
                             Public API surface (JqValue, JqMapper, JqYaml, annotations,
                             bridges, jakarta) is fully documented. Internal classes
                             (VM, evaluator, compiler, parser, adapter engines) are not
                             user-facing and have incomplete javadoc. -->
                        <doclint>all,-missing</doclint>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>${version.sonatype.central}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <publishingServerId>central</publishingServerId>
                        <autoPublish>true</autoPublish>
                        <waitUntil>published</waitUntil>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <configuration>
                        <releaseProfiles>release</releaseProfiles>
                        <tagNameFormat>@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>benchmark</id>
            <modules>
                <module>jjq-benchmark</module>
            </modules>
        </profile>
        <profile>
            <id>examples</id>
            <modules>
                <module>jjq-examples</module>
            </modules>
        </profile>

        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>release</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <extensions>true</extensions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${version.maven.source}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${version.maven.javadoc}</version>
                        <configuration>
                            <release>22</release>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${version.maven.gpg}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <!-- Passphrase comes from MAVEN_GPG_PASSPHRASE env in CI;
                                         without this gpg blocks waiting on an agent. -->
                                    <useAgent>false</useAgent>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
