<?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>me.hsgamer</groupId>
    <artifactId>minigamecore</artifactId>
    <version>2.2.2</version>
    <packaging>pom</packaging>

    <name>MinigameCore</name>
    <description>A core library for minigame development</description>
    <url>https://github.com/HSGamer/MinigameCore</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://github.com/HSGamer/MinigameCore/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/HSGamer/MinigameCore/issues</url>
    </issueManagement>

    <scm>
        <connection>scm:git:https://github.com/HSGamer/MinigameCore.git</connection>
        <developerConnection>scm:git:git@github.com:HSGamer/MinigameCore.git</developerConnection>
        <url>https://github.com/HSGamer/MinigameCore</url>
    </scm>

    <modules>
        <module>minigamecore-base</module>
        <module>minigamecore-implementation</module>
        <module>minigamecore-bukkit</module>
        <module>minigamecore-bukkit-simple</module>
        <module>minigamecore-bukkit-hscore</module>
        <module>minigamecore-standalone</module>
    </modules>

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

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
                <groupId>org.apache.maven.plugins</groupId>
                <version>3.11.0</version>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <id>attach-sources</id>
                    </execution>
                </executions>
                <groupId>org.apache.maven.plugins</groupId>
                <version>3.2.1</version>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <id>attach-javadocs</id>
                    </execution>
                </executions>
                <groupId>org.apache.maven.plugins</groupId>
                <version>3.5.0</version>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>jenkins</id>
            <activation>
                <property>
                    <name>env.JENKINS_HOME</name>
                </property>
            </activation>

            <distributionManagement>
                <repository>
                    <id>codemc-releases</id>
                    <url>https://repo.codemc.io/repository/maven-releases/</url>
                </repository>
                <snapshotRepository>
                    <id>codemc-snapshots</id>
                    <url>https://repo.codemc.io/repository/maven-snapshots/</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
        <profile>
            <id>github</id>
            <activation>
                <property>
                    <name>env.GITHUB_WORKFLOW</name>
                </property>
            </activation>

            <distributionManagement>
                <repository>
                    <id>github</id>
                    <name>GitHub Packages</name>
                    <url>https://maven.pkg.github.com/HSGamer/MinigameCore</url>
                </repository>
            </distributionManagement>
        </profile>

        <profile>
            <id>sonatype</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <!-- Prevent `gpg` from using pinentry programs -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.13</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>

            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>ossrh</id>
                    <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>
</project>