<!--

    SPDX-License-Identifier: MIT

    The MIT License (MIT)

    Copyright (c) 2015-2022 games647 and contributors

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.

-->
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <properties>
        <nettyVersion>4.1.77.Final</nettyVersion>
    </properties>

    <parent>
        <groupId>com.github.games647</groupId>
        <artifactId>fastlogin</artifactId>
        <version>1.12-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <!--This has to be in lowercase because it's used by plugin.yml-->
    <artifactId>fastlogin.bukkit</artifactId>
    <packaging>jar</packaging>

    <name>FastLoginBukkit</name>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <createDependencyReducedPom>false</createDependencyReducedPom>
                    <shadedArtifactAttached>false</shadedArtifactAttached>
                    <relocations>
                        <relocation>
                            <pattern>com.zaxxer.hikari</pattern>
                            <shadedPattern>fastlogin.hikari</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>org.slf4j</pattern>
                            <shadedPattern>fastlogin.slf4j</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>net.md_5.bungee.config</pattern>
                            <shadedPattern>fastlogin.config</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>com.google.gson</pattern>
                            <shadedPattern>fastlogin.gson</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>com.google.common</pattern>
                            <shadedPattern>fastlogin.guava</shadedPattern>
                            <excludes>
                                <exclude>com.google.common.collect.Multimap</exclude>
                            </excludes>
                        </relocation>
                        <relocation>
                            <pattern>io.papermc.lib</pattern>
                            <shadedPattern>fastlogin.paperlib</shadedPattern>
                        </relocation>
                    </relocations>
                    <!-- Rename the service file too to let SLF4J api find our own relocated jdk logger -->
                    <!-- Located in META-INF/services -->
                    <transformers>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                    </transformers>
                    <minimizeJar>true</minimizeJar>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>META-INF/MANIFEST.MF</exclude>
                                <exclude>**/module-info.class</exclude>
                            </excludes>
                        </filter>
                    </filters>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <!-- PaperSpigot API and PaperLib -->
        <repository>
            <id>papermc</id>
            <url>https://papermc.io/repo/repository/maven-public/</url>
        </repository>

        <!-- ProtocolLib -->
        <repository>
            <id>dmulloy2-repo</id>
            <url>https://repo.dmulloy2.net/repository/public/</url>
        </repository>

        <!-- AuthMe Reloaded, xAuth and LoginSecurity -->
        <repository>
            <id>codemc-releases</id>
            <url>https://repo.codemc.io/repository/maven-public/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>

        <!-- PlaceholderAPI -->
        <repository>
            <id>placeholderapi</id>
            <url>https://repo.extendedclip.com/content/repositories/placeholderapi</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>

        <!-- GitHub automatic maven builds -->
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <dependencies>
        <!--Common plugin component-->
        <dependency>
            <groupId>com.github.games647</groupId>
            <artifactId>fastlogin.core</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- PaperSpigot API for correcting user cache usage -->
        <dependency>
            <groupId>io.papermc.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.19-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
            <!-- Use our own newer api version -->
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- PaperLib for checking if server uses PaperSpigot -->
        <dependency>
            <groupId>io.papermc</groupId>
            <artifactId>paperlib</artifactId>
            <version>1.0.7</version>
        </dependency>

        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>datafixerupper</artifactId>
            <version>5.0.28</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!--Library for listening and sending Minecraft packets-->
        <dependency>
            <groupId>com.comphenix.protocol</groupId>
            <artifactId>ProtocolLib</artifactId>
            <version>5.0.0-SNAPSHOT</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!--Changing onlinemode on login process-->
        <dependency>
            <groupId>com.github.ProtocolSupport</groupId>
            <artifactId>ProtocolSupport</artifactId>
            <!--4.29.dev after commit about API improvements-->
            <version>master-66b494a8dd-1</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!--Floodgate for Xbox Live Authentication-->
        <dependency>
            <groupId>org.geysermc.floodgate</groupId>
            <artifactId>api</artifactId>
            <version>2.2.0-SNAPSHOT</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.geysermc.cumulus</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Bedrock player bridge -->
        <dependency>
            <groupId>org.geysermc</groupId>
            <artifactId>core</artifactId>
            <version>${geyser.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- We need the API, but it was excluded above -->
        <dependency>
            <groupId>org.geysermc</groupId>
            <artifactId>geyser-api</artifactId>
            <version>${geyser.version}</version>
            <scope>provided</scope>
        </dependency>

        <!--Provide premium placeholders-->
        <dependency>
            <groupId>me.clip</groupId>
            <artifactId>placeholderapi</artifactId>
            <version>2.11.2</version>
            <scope>provided</scope>
            <optional>true</optional>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!--Login Plugins-->
        <dependency>
            <groupId>fr.xephi</groupId>
            <artifactId>authme</artifactId>
            <version>5.6.0-beta2</version>
            <scope>provided</scope>
            <optional>true</optional>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.lenis0012.bukkit</groupId>
            <artifactId>loginsecurity</artifactId>
            <version>3.1</version>
            <scope>provided</scope>
            <optional>true</optional>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.github.games647</groupId>
            <artifactId>LogIt</artifactId>
            <version>9e3581db27</version>
            <scope>provided</scope>
            <optional>true</optional>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>de.luricos.bukkit</groupId>
            <artifactId>xAuth</artifactId>
            <version>2.6</version>
            <scope>provided</scope>
            <optional>true</optional>
            <!--These artifacts produce conflicts on downloading-->
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!--No maven repository :(-->
        <dependency>
            <groupId>de.st_ddt.crazy</groupId>
            <artifactId>CrazyCore</artifactId>
            <version>10.7.7</version>
            <optional>true</optional>
            <scope>system</scope>
            <systemPath>${project.basedir}/lib/CrazyCore v10.7.7.jar</systemPath>
        </dependency>

        <dependency>
            <groupId>de.st_ddt.crazy</groupId>
            <artifactId>CrazyLogin</artifactId>
            <version>7.23</version>
            <optional>true</optional>
            <scope>system</scope>
            <systemPath>${project.basedir}/lib/CrazyLogin v7.23.2.jar</systemPath>
        </dependency>

        <dependency>
            <groupId>ultraauth</groupId>
            <artifactId>ultraauth</artifactId>
            <version>2.0.2</version>
            <optional>true</optional>
            <scope>system</scope>
            <systemPath>${project.basedir}/lib/UltraAuth v2.1.2.jar</systemPath>
        </dependency>

        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk18on</artifactId>
            <version>1.71</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport</artifactId>
            <version>${nettyVersion}</version>
            <scope>test</scope>
        </dependency>        
        
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-codec</artifactId>
            <version>${nettyVersion}</version>
            <scope>test</scope>
        </dependency>

        <!-- Provided by the spigot, required for testing ProtocolLib -->
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
