<?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.pro4d</groupId>
    <artifactId>QuickMC-Utils</artifactId>
    <version>1.1.2-beta21</version>
    <packaging>jar</packaging>

    <name>QuickMC-Utils</name>
    <description>Many useful utility methods, classes, and bundled apis for use in minecraft plugins</description>
    <url>https://github.com/Pro4D/QuickMC-Util</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>pro4d</id>
            <name>Pro 4D</name>
            <email>pro4d.dev@gmail.com</email>
            <url>https://github.com/Pro4D</url>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/Pro4D/QuickMC-Util.git</connection>
        <developerConnection>scm:git:ssh://github.com:Pro4D/QuickMC-Util.git</developerConnection>
        <url>https://github.com/Pro4D/QuickMC-Util/tree/master</url>
    </scm>

    <properties>
        <java.version>21</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <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>

    <build>
        <defaultGoal>clean package</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.5.3</version>
                <configuration>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>META-INF/maven/</exclude>
                                <exclude>META-INF/*.SF</exclude>
                                <exclude>META-INF/*.DSA</exclude>
                                <exclude>META-INF/*.RSA</exclude>
                            </excludes>
                        </filter>
                    </filters>
                    <relocations>
                        <relocation>
                            <pattern>de.themoep.minedown</pattern>
                            <shadedPattern>io.github.pro4d.quickmc.minedown</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>com.cryptomorin.xseries</pattern>
                            <shadedPattern>io.github.pro4d.quickmc.xseries</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>org.apache.commons.text</pattern>
                            <shadedPattern>io.github.pro4d.quickmc.text</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>de.themoep.minedown</pattern>
                            <shadedPattern>io.github.pro4d.quickmc.minedown</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>de.tr7zw.changeme.nbtapi</pattern>
                            <shadedPattern>io.github.pro4d.quickmc.nbtapi</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>com.github.yannicklamprecht</pattern>
                            <shadedPattern>io.github.pro4d.quickmc.worldborderapi</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>dev.jorel.commandapi</pattern>
                            <shadedPattern>io.github.pro4d.quickmc.commandapi</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>fr.skytasul.glowingentities</pattern>
                            <shadedPattern>io.github.pro4d.quickmc.glowingentities</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <profiles>
        <profile>
            <id>ossrh</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <additionalOptions>
                                <additionalOption>-Xdoclint:none</additionalOption>
                            </additionalOptions>
                            <tags>
                                <tag>
                                    <name>apiNote</name>
                                    <placement>a</placement>
                                    <head>API Note:</head>
                                </tag>
                            </tags>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <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-gpg-plugin</artifactId>
                        <version>3.2.7</version>
                        <configuration>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                            <executable>C:\Program Files (x86)\gnupg\bin\gpg.exe</executable>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                            <waitUntil>uploaded</waitUntil>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>papermc-repo</id>
            <url>https://repo.papermc.io/repository/maven-public/</url>
        </repository>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>codemc-releases</id>
            <url>https://repo.codemc.io/repository/maven-releases/</url>
        </repository>
        <repository>
            <id>codemc-snapshots</id>
            <url>https://repo.codemc.io/repository/maven-snapshots/</url>
        </repository>
        <repository>
            <id>placeholderapi</id>
            <url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
        </repository>
        <repository>
            <id>minebench-repo</id>
            <url>https://repo.minebench.de/</url>
        </repository>
        <repository>
            <id>evoke-snapshots</id>
            <name>EvokeGames Maven</name>
            <url>https://maven.evokegames.gg/snapshots</url>
        </repository>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>io.papermc.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.21-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.21-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

<!--        GlowingEntity-->
        <dependency>
            <groupId>fr.skytasul</groupId>
            <artifactId>glowingentities</artifactId>
            <version>1.4.3</version>
            <scope>compile</scope>
        </dependency>
<!--        Reflection-->
        <dependency>
            <groupId>com.github.cryptomorin</groupId>
            <artifactId>XSeries</artifactId>
            <version>12.1.0</version>
            <exclusions>
                <exclusion>
                    <groupId>com.google.code.gson</groupId>
                    <artifactId>gson</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

<!--        CommandAPI-->
        <dependency>
            <groupId>dev.jorel</groupId>
            <artifactId>commandapi-bukkit-shade</artifactId>
            <version>9.7.0</version>
        </dependency>

<!--        Chat Formatting-->
        <dependency>
            <groupId>de.themoep</groupId>
            <artifactId>minedown</artifactId>
            <version>1.7.1-SNAPSHOT</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>net.kyori</groupId>
            <artifactId>adventure-platform-bukkit</artifactId>
            <version>4.3.4</version>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <groupId>us.myles</groupId>
                    <artifactId>viaversion-common</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>net.kyori</groupId>
                    <artifactId>adventure-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>net.kyori</groupId>
                    <artifactId>adventure-text-serializer-gson</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
            <version>1.13.0</version>
        </dependency>
        <dependency>
            <groupId>me.clip</groupId>
            <artifactId>placeholderapi</artifactId>
            <version>2.11.6</version>
            <scope>provided</scope>
        </dependency>

<!--        Lombok-->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.36</version>
            <scope>provided</scope>
        </dependency>

<!--        PacketEvents & EntityLib-->
        <dependency>
            <groupId>com.github.retrooper</groupId>
            <artifactId>packetevents-spigot</artifactId>
            <version>2.7.0</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>net.kyori</groupId>
                    <artifactId>adventure-key</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>net.kyori</groupId>
                    <artifactId>examination-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.github.Tofaa2.EntityLib</groupId>
            <artifactId>spigot</artifactId>
            <version>b8df40f</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>
</project>
