<?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.github.nramc</groupId>
    <artifactId>geojson4j</artifactId>
    <version>1.0.0</version>

    <name>geojson4j</name>
    <description>
        A lightweight Java library for working with GeoJSON data, compliant with RFC 7946. geojson4j provides
        easy-to-use classes and utilities for creating, parsing, and serializing GeoJSON objects, such as Points,
        LineStrings, Polygons, and FeatureCollections, following the official GeoJSON specification.
    </description>
    <url>https://github.com/nramc/geojson4j</url>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <developers>
        <developer>
            <id>nramc</id>
            <name>Ramachandran Nellaiyappan</name>
            <email>ramachandrannellai@gmail.com</email>
            <url>https://github.com/nramc</url>
            <roles>
                <role>Maintainer</role>
            </roles>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/nramc/geojson4j</url>
        <connection>scm:git:https://github.com/nramc/geojson4j.git</connection>
        <developerConnection>scm:git:https://github.com/nramc/geojson4j.git</developerConnection>
        <tag>v1.0.0</tag>
    </scm>
    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <properties>
        <java.version>21</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <sonar.organization>nramc</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>

        <central-publishing-maven-plugin.version>0.6.0</central-publishing-maven-plugin.version>
        <jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
        <maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
        <maven-javadoc-plugin.version>3.11.1</maven-javadoc-plugin.version>
        <maven-release-plugin.version>3.1.1</maven-release-plugin.version>
        <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
        <rewrite-java-security.version>2.15.0</rewrite-java-security.version>
        <rewrite-maven-plugin.skip.run-execution>false</rewrite-maven-plugin.skip.run-execution>
        <rewrite-maven-plugin.skip.dry-run-execution>false</rewrite-maven-plugin.skip.dry-run-execution>
        <rewrite-logging-frameworks.version>2.16.1</rewrite-logging-frameworks.version>
        <rewrite-maven-plugin.version>5.45.1</rewrite-maven-plugin.version>
        <rewrite-recommendations.version>1.13.0</rewrite-recommendations.version>
        <rewrite-static-analysis.version>1.20.0</rewrite-static-analysis.version>
        <rewrite-testing-frameworks.version>2.22.0</rewrite-testing-frameworks.version>
        <maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
        <commons-collections4.version>4.4</commons-collections4.version>
        <commons-lang3.version>3.17.0</commons-lang3.version>
        <assertj-core.version>3.26.3</assertj-core.version>
        <maven-site-plugin.version>3.21.0</maven-site-plugin.version>
        <asciidoctor-converter-doxia-module.version>3.1.1</asciidoctor-converter-doxia-module.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- JUnit 5 BOM -->
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>5.11.3</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>2.18.1</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- logging framework dependencies -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.16</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.5.12</version>
        </dependency>

        <!--  Jackson JSON dependencies  -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
        </dependency>

        <!--  utility dependencies  -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>${commons-collections4.version}</version>
        </dependency>

        <!--  testing framework dependencies  -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj-core.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>


    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin.version}</version>
                <configuration>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</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>${maven-javadoc-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <additionalJOption>-Xdoclint:none</additionalJOption>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>${central-publishing-maven-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>ossrh</publishingServerId>
                    <autoPublish>true</autoPublish>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>${maven-site-plugin.version}</version>
                <dependencies>
                    <dependency> <!-- Add Asciidoctor Doxia Module -->
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctor-converter-doxia-module</artifactId>
                        <version>${asciidoctor-converter-doxia-module.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>github</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                                <configuration>
                                    <formats>
                                        <format>XML</format>
                                    </formats>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>open-rewrite</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.openrewrite.maven</groupId>
                        <artifactId>rewrite-maven-plugin</artifactId>
                        <version>${rewrite-maven-plugin.version}</version>
                        <executions>

                            <execution>
                                <id>run-open-rewrite-execution</id>
                                <goals>
                                    <goal>runNoFork</goal>
                                </goals>
                                <phase>process-sources</phase>
                                <configuration>
                                    <rewriteSkip>${rewrite-maven-plugin.skip.run-execution}</rewriteSkip>
                                </configuration>
                            </execution>
                            <execution>
                                <id>dry-run-open-rewrite-execution</id>
                                <goals>
                                    <goal>dryRunNoFork</goal>
                                </goals>
                                <phase>prepare-package</phase>
                                <configuration>
                                    <rewriteSkip>${rewrite-maven-plugin.skip.dry-run-execution}</rewriteSkip>
                                </configuration>
                            </execution>
                        </executions>
                        <configuration>
                            <failOnDryRunResults>true</failOnDryRunResults>
                            <activeRecipes>
                                <recipe>com.github.nramc.recipes.sources</recipe>
                                <recipe>com.github.nramc.recipes.testing</recipe>
                            </activeRecipes>
                            <activeStyles>
                                <style>org.openrewrite.java.IntelliJ</style>
                            </activeStyles>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>org.openrewrite.recipe</groupId>
                                <artifactId>rewrite-static-analysis</artifactId>
                                <version>${rewrite-static-analysis.version}</version>
                            </dependency>
                            <dependency>
                                <groupId>org.openrewrite.recipe</groupId>
                                <artifactId>rewrite-recommendations</artifactId>
                                <version>${rewrite-recommendations.version}</version>
                            </dependency>
                            <dependency>
                                <groupId>org.openrewrite.recipe</groupId>
                                <artifactId>rewrite-testing-frameworks</artifactId>
                                <version>${rewrite-testing-frameworks.version}</version>
                            </dependency>
                            <dependency>
                                <groupId>org.openrewrite.recipe</groupId>
                                <artifactId>rewrite-java-security</artifactId>
                                <version>${rewrite-java-security.version}</version>
                            </dependency>
                            <dependency>
                                <groupId>org.openrewrite.recipe</groupId>
                                <artifactId>rewrite-logging-frameworks</artifactId>
                                <version>${rewrite-logging-frameworks.version}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>ci-profile</id>
            <properties>
                <rewrite-maven-plugin.skip.run-execution>true</rewrite-maven-plugin.skip.run-execution>
            </properties>
            <activation>
                <property>
                    <name>env.CI</name>
                    <value>true</value>
                </property>
            </activation>
        </profile>
    </profiles>

</project>