<?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>com.github.cryptomorin</groupId>
    <artifactId>kingdoms</artifactId>
    <version>1.10.5.3</version>
    <packaging>jar</packaging>

    <name>Kingdoms</name>
    <description>Battles for might, land and glory.</description>
    <url>https://www.spigotmc.org/resources/77670/</url>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/CryptoMorin/XSeries/issues</url>
    </issueManagement>

    <!-- Sep 5, 2015 -->
    <inceptionYear>2015</inceptionYear>

    <developers>
        <developer>
            <id>CryptoMorin</id>
            <name>Crypto Morin</name>
            <roles>
                <role>Owner</role>
            </roles>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>

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

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.resources.sourceEncoding>UTF-8</project.resources.sourceEncoding>

        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <repositories>
        <repository>
            <id>nms-repo</id>
            <url>https://repo.codemc.org/repository/nms/</url>
        </repository>
        <repository>
            <id>minecraft-repo</id>
            <url>https://libraries.minecraft.net/</url>
        </repository>
        <repository>
            <id>sk89q-repo</id>
            <url>https://maven.enginehub.org/repo/</url>
        </repository>
        <repository>
            <id>placeholderapi</id>
            <url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
        </repository>
        <repository>
            <id>nexus</id>
            <name>Lumine Releases</name>
            <url>https://mvn.lumine.io/repository/maven-public/</url>
        </repository>
        <repository>
            <id>mvdw-software</id>
            <name>MVdW Public Repositories</name>
            <url>http://repo.mvdw-software.be/content/groups/public/</url>
        </repository>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io/</url>
        </repository>
        <repository>
            <id>Scarsz-Nexus</id>
            <url>https://nexus.scarsz.me/content/groups/public/</url>
        </repository>
    </repositories>

    <dependencies>

        <dependency>
            <groupId>com.github.cryptomorin</groupId>
            <artifactId>XSeries</artifactId>
            <version>7.6.0.1</version>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.discordsrv</groupId>
            <artifactId>discordsrv</artifactId>
            <version>1.19.0</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!--        <dependency>-->
        <!--            <groupId>me.lucko</groupId>-->
        <!--            <artifactId>commodore</artifactId>-->
        <!--            <version>1.9</version>-->
        <!--            <scope>compile</scope>-->
        <!--        </dependency>-->

        <dependency>
            <groupId>com.sk89q.worldguard</groupId>
            <artifactId>worldguard-bukkit</artifactId>
            <version>7.0.4-SNAPSHOT</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.spigotmc</groupId>
                    <artifactId>spigot-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>us.dynmap</groupId>
            <artifactId>DynmapCoreAPI</artifactId>
            <version>3.1</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.sk89q.worldedit</groupId>
            <artifactId>worldedit-bukkit</artifactId>
            <version>7.2.0-SNAPSHOT</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.github.ben-manes.caffeine</groupId>
            <artifactId>caffeine</artifactId>
            <version>2.8.6</version>
        </dependency>

        <dependency>
            <groupId>net.luckperms</groupId>
            <artifactId>api</artifactId>
            <version>5.1</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.16.4-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>me.clip</groupId>
            <artifactId>placeholderapi</artifactId>
            <version>2.10.6</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.lumine.xikage</groupId>
            <artifactId>MythicMobs</artifactId>
            <version>4.9.1</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>be.maximvdw</groupId>
            <artifactId>MVdWPlaceholderAPI</artifactId>
            <version>3.1.1-SNAPSHOT</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.github.MilkBowl</groupId>
            <artifactId>VaultAPI</artifactId>
            <version>1.7</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>de.Keyle.MyPet</groupId>
            <artifactId>mypet</artifactId>
            <version>3.0</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>fr.xephi.authme</groupId>
            <artifactId>authme</artifactId>
            <version>5.0.0</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.github.Jikoo</groupId>
            <artifactId>Regionerator</artifactId>
            <version>2.2.1</version>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>sources-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <archive>
                                <manifest>
                                    <mainClass>Main</mainClass>
                                </manifest>
                            </archive>
                            <classifier>sources</classifier>
                            <classesDirectory>${basedir}/sources</classesDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <!-- https://repo.maven.apache.org/maven2/org/sonatype/plugins/nexus-staging-maven-plugin/ -->
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <!--all,-missing-->
                    <doclint>none</doclint>
                    <source>8</source>
                    <!-- Apparently this is needed because it's a bug with maven JavaDoc plugin not being able to find the exe by itself. -->
                    <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <configuration>
                    <finalName>${project.name}-${project.version}</finalName>
                    <relocations>
                        <relocation>
                            <pattern>com.cryptomorin.xseries</pattern>
                            <shadedPattern>org.kingdoms.utils.xseries</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>com.github.benmanes.caffeine</pattern>
                            <shadedPattern>org.kingdoms.utils.caffeine</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>org.checkerframework</pattern>
                            <shadedPattern>org.kingdoms.utils.caffeine.checkerframework</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>com.google.errorprone</pattern>
                            <shadedPattern>org.kingdoms.utils.caffeine.errorprone</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>me.lucko.commodore</pattern>
                            <shadedPattern>org.kingdoms.utils.commodore</shadedPattern>
                        </relocation>
                    </relocations>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>META-INF/MANIFEST.MF</exclude>
                                <exclude>META-INF/maven/**</exclude>
                                <exclude>META-INF/*LICENSE*</exclude>

                                <exclude>com/cryptomorin/xseries/NMSExtras*</exclude>
                                <exclude>com/cryptomorin/xseries/NoteBlockMusic*</exclude>
                                <exclude>com/cryptomorin/xseries/SkullCacheListener*</exclude>
                            </excludes>
                        </filter>
                    </filters>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>
</project>