<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>

    <groupId>net.viper.bungee</groupId>
    <artifactId>StatusAPI</artifactId>
    <version>4.1.3</version>
    <packaging>jar</packaging>

    <name>StatusAPI</name>
    <description>BungeeCord Status API Plugin</description>

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

    <dependencies>
        <!-- BungeeCord API – direkt aus lokalem JAR, kein Repository noetig -->
        <dependency>
            <groupId>net.md-5</groupId>
            <artifactId>bungeecord-api</artifactId>
            <version>1.20</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/lib/BungeeCord.jar</systemPath>
        </dependency>

        <!-- LuckPerms API (Optional) -->
        <dependency>
            <groupId>net.luckperms</groupId>
            <artifactId>api</artifactId>
            <version>5.4</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>

        <!-- HikariCP Connection Pool (wird ins JAR gepackt) -->
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
            <version>5.1.0</version>
            <scope>compile</scope>
        </dependency>

        <!-- MySQL JDBC Treiber (wird ins JAR gepackt) -->
        <dependency>
            <groupId>com.mysql</groupId>
            <artifactId>mysql-connector-j</artifactId>
            <version>9.1.0</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
        </repository>
        <repository>
            <id>luckperms</id>
            <url>https://repo.luckperms.net/releases/</url>
        </repository>
    </repositories>

    <build>
        <finalName>StatusAPI</finalName>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.5.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals><goal>shade</goal></goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <relocations>
                                <relocation>
                                    <pattern>com.zaxxer.hikari</pattern>
                                    <shadedPattern>net.viper.status.hikari</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.mysql</pattern>
                                    <shadedPattern>net.viper.status.mysql</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>