<?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>org.hisp.dhis</groupId>
    <artifactId>json-tree</artifactId>
    <packaging>jar</packaging>
    <name>JSON Tree</name>
    <url>https://github.com/dhis2/json-tree</url>
    <version>1.14.0</version>

    <developers>
        <developer>
            <id>jbee</id>
            <name>Jan Bernitt</name>
            <email>jbernitt@dhis2.org</email>
            <organizationUrl>https://dhis2.org</organizationUrl>
        </developer>
    </developers>

    <description>
        **json-tree** is a zero-dependency Java JSON library for large payloads you process dynamically.
        It lazily parses to a virtual tree, keeps memory close to the source text,
        and gives you RFC 9535-style query, JSON Patch, diff, and schema validation
        in one small package—without Jackson’s object graph or multiple separate dependencies.
    </description>

    <organization>
        <name>UiO</name>
        <url>http://www.dhis2.org</url>
    </organization>

    <licenses>
        <license>
            <name>BSD</name>
            <url>http://opensource.org/licenses/BSD-2-Clause</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:dhis2/json-tree.git</connection>
        <developerConnection>scm:git:git@github.com:dhis2/json-tree.gitt</developerConnection>
        <url>git@github.com:dhis2/json-tree.git</url>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/dhis2/json-tree</url>
    </issueManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <gpg.skip>true</gpg.skip>
        <jmh.version>1.37</jmh.version>
        <build-helper.version>3.6.1</build-helper.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>5.9.3</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.1.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <release>17</release>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.5.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <additionalOptions>-Xdoclint:-missing</additionalOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.0.1</version>
                <configuration>
                    <gpgArguments>
                        <arg>--pinentry-mode</arg>
                        <arg>loopback</arg>
                    </gpgArguments>
                </configuration>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.12.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                    <deploymentName>DHIS JSON Tree</deploymentName>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>jmh</id>

            <dependencies>
                <dependency>
                    <groupId>org.openjdk.jmh</groupId>
                    <artifactId>jmh-core</artifactId>
                    <version>${jmh.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.openjdk.jmh</groupId>
                    <artifactId>jmh-generator-annprocess</artifactId>
                    <version>${jmh.version}</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <!-- Register src/jmh/java as an additional test source root -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <version>${build-helper.version}</version>
                        <executions>
                            <execution>
                                <id>add-jmh-test-source</id>
                                <phase>generate-test-sources</phase>
                                <goals><goal>add-test-source</goal></goals>
                                <configuration>
                                    <sources><source>src/jmh/java</source></sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!--
                      Permit the named module to read the unnamed module (classpath)
                      so the JMH annotations resolve. Only needed when the jmh
                      profile is active.
                    -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-testCompile</id>
                                <configuration>
                                    <compilerArgs combine.self="override">
                                        <arg>--add-reads</arg>
                                        <arg>org.hisp.dhis.jsontree=ALL-UNNAMED</arg>
                                    </compilerArgs>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
