<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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.projectunified</groupId>
    <artifactId>craftconfig</artifactId>
    <version>0.3.1</version>
    <packaging>pom</packaging>

    <name>CraftConfig</name>
    <description>A config interface for various config libraries</description>
    <url>https://github.com/ProjectUnified/${project.name}</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://github.com/ProjectUnified/${project.name}/blob/master/LICENSE</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>HSGamer</name>
            <email>huynhqtienvtag@gmail.com</email>
            <url>https://github.com/HSGamer</url>
        </developer>
    </developers>

    <issueManagement>
        <system>github</system>
        <url>https://github.com/ProjectUnified/${project.name}/issues</url>
    </issueManagement>

    <scm>
        <connection>scm:git:https://github.com/ProjectUnified/${project.name}.git</connection>
        <developerConnection>scm:git:git@github.com:ProjectUnified/${project.name}.git</developerConnection>
        <url>https://github.com/ProjectUnified/${project.name}</url>
    </scm>

    <modules>
        <module>gson-util</module>
        <module>common</module>
        <module>annotation</module>
        <module>proxy</module>
        <module>gson</module>
        <module>configurate</module>
        <module>bukkit</module>
        <module>bukkit-converter</module>
        <module>bungeecord</module>
        <module>bukkit-example</module>
        <module>bom</module>
    </modules>

    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.deploy.skip>false</maven.deploy.skip>
        <gson.version>2.14.0</gson.version>
        <configurate.version>4.2.0</configurate.version>
        <annotations.version>26.1.0</annotations.version>
        <spigot.version>1.18.2-R0.1-20220607.160742-53</spigot.version>
        <bungeecord.version>1.21-R0.4</bungeecord.version>
        <junit.version>6.1.2</junit.version>
        <mockito.version>5.23.0</mockito.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Internal modules -->
            <dependency>
                <groupId>io.github.projectunified</groupId>
                <artifactId>craftconfig-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.projectunified</groupId>
                <artifactId>craftconfig-annotation</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.projectunified</groupId>
                <artifactId>craftconfig-proxy</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.projectunified</groupId>
                <artifactId>craftconfig-gson-util</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.projectunified</groupId>
                <artifactId>craftconfig-gson</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.projectunified</groupId>
                <artifactId>craftconfig-configurate</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.projectunified</groupId>
                <artifactId>craftconfig-bukkit</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.projectunified</groupId>
                <artifactId>craftconfig-bukkit-converter</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.projectunified</groupId>
                <artifactId>craftconfig-bungeecord</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- External dependencies -->
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>${gson.version}</version>
            </dependency>
            <dependency>
                <groupId>org.spongepowered</groupId>
                <artifactId>configurate-core</artifactId>
                <version>${configurate.version}</version>
            </dependency>
            <dependency>
                <groupId>org.spongepowered</groupId>
                <artifactId>configurate-yaml</artifactId>
                <version>${configurate.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jetbrains</groupId>
                <artifactId>annotations</artifactId>
                <version>${annotations.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot-api</artifactId>
                <version>${spigot.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>net.md-5</groupId>
                <artifactId>bungeecord-api</artifactId>
                <version>${bungeecord.version}</version>
                <scope>provided</scope>
            </dependency>

            <!-- Test dependencies -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <testSource>11</testSource>
                    <testTarget>11</testTarget>
                    <testRelease>11</testRelease>
                </configuration>
                <groupId>org.apache.maven.plugins</groupId>
                <version>3.15.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.4.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <id>attach-sources</id>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.12.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <id>attach-javadocs</id>
                    </execution>
                </executions>
                <configuration>
                    <outputDirectory>${project.build.directory}/reports</outputDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.5.6</version>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>central</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.8</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>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.11.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                            <deploymentName>${project.name}</deploymentName>
                            <skipPublishing>${maven.deploy.skip}</skipPublishing>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>bungeecord-repo</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </repository>
    </repositories>
</project>
