<?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.haibiiin</groupId>
    <artifactId>json-repair</artifactId>
    <version>0.3.1</version>
    <name>JSON Repair</name>
    <description>Repair JSON! A library for fixing JSON anomalies generated by LLMs.</description>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <antlr4.version>4.8</antlr4.version>
        <junit.version>5.8.2</junit.version>
        <xstream.version>1.4.21</xstream.version>
        <jmh.version>1.37</jmh.version>
        <annotations.version>24.1.0</annotations.version>

        <antlr4-maven-plugin.version>4.8</antlr4-maven-plugin.version>
        <spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version>

        <maven-source-plugin.version>2.2.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
        <central-publishing-maven-plugin.version>0.7.0</central-publishing-maven-plugin.version>
        <maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.antlr</groupId>
            <artifactId>antlr4-runtime</artifactId>
            <version>${antlr4.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>${annotations.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
            <version>${xstream.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-core</artifactId>
            <version>${jmh.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-generator-annprocess</artifactId>
            <version>${jmh.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${spotless-maven-plugin.version}</version>
                <configuration>
                    <java>
                        <importOrder />
                        <removeUnusedImports/>
                        <eclipse>
                            <file>${maven.multiModuleProjectDirectory}/spotless/java-style.xml</file>
                        </eclipse>
                        <licenseHeader>
                            <file>${maven.multiModuleProjectDirectory}/spotless/copyright</file>
                        </licenseHeader>
                    </java>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.antlr</groupId>
                <artifactId>antlr4-maven-plugin</artifactId>
                <version>${antlr4-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>antlr</id>
                        <configuration>
                            <sourceDirectory>${basedir}/src/main/antlr4</sourceDirectory>
                            <outputDirectory>${project.build.directory}/generated-sources/antlr4/io/github/haibiiin/json/repair/antlr/autogen</outputDirectory>
                            <listener>true</listener>
                            <visitor>true</visitor>
                            <arguments>
                                <argument>-package</argument>
                                <argument>io.github.haibiiin.json.repair.antlr.autogen</argument>
                            </arguments>
                        </configuration>
                        <goals>
                            <goal>antlr4</goal>
                        </goals>
                    </execution>
                </executions>
            </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>
            </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>central</publishingServerId>
                </configuration>
            </plugin>
            <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>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <developers>
        <developer>
            <id>HAibiiin</id>
        </developer>
    </developers>

    <url>https://github.com/HAibiiin/json-repair</url>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/HAibiiin/json-repair.git</connection>
        <developerConnection>scm:git:https://github.com/HAibiiin/json-repair.git</developerConnection>
        <url>https://github.com/HAibiiin/json-repair.git</url>
    </scm>

</project>