<?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>net.viper</groupId>
    <artifactId>StatusAPIBridge</artifactId>
    <version>1.0.2</version>
    <packaging>jar</packaging>

    <properties>
        <!-- Niedrigste gemeinsame Basis: Java 17 (läuft auf 1.21.1 und 26.1.2) -->
        <java.version>17</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!-- Standard-API-Version (wird durch Profile überschrieben) -->
        <spigot.version>1.21.1-R0.1-SNAPSHOT</spigot.version>
    </properties>

    <repositories>
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>vault-repo</id>
            <url>https://nexus.hc.to/content/repositories/pub_releases/</url>
        </repository>
        <repository>
            <id>placeholderapi</id>
            <url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
        </repository>
    </repositories>

    <dependencies>
        <!-- Spigot API – Version wird durch Profil gesteuert -->
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>${spigot.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Vault -->
        <dependency>
            <groupId>net.milkbowl.vault</groupId>
            <artifactId>VaultAPI</artifactId>
            <version>1.7</version>
            <scope>provided</scope>
        </dependency>
        <!-- PlaceholderAPI (optional – per Reflection genutzt) -->
        <dependency>
            <groupId>me.clip</groupId>
            <artifactId>placeholderapi</artifactId>
            <version>2.11.6</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <!-- ══════════════════════════════════════════════════════════════════════
         Maven-Profile für Multi-Version-Build
         mvn package              → mc-1.21.1  (Standard)
         mvn package -P mc-26.1.2 → mc-26.1.2
         ══════════════════════════════════════════════════════════════════════ -->
    <profiles>

        <!-- Profil 1: Minecraft 1.21.1 (Standard) -->
        <profile>
            <id>mc-1.21.1</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <spigot.version>1.21.1-R0.1-SNAPSHOT</spigot.version>
            </properties>
        </profile>

        <!-- Profil 2: Minecraft 26.1.2 -->
        <profile>
            <id>mc-26.1.2</id>
            <properties>
                <spigot.version>1.21.1-R0.1-SNAPSHOT</spigot.version>
            </properties>
        </profile>

    </profiles>

    <build>
        <finalName>StatusAPIBridge</finalName>
        <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>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.5.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals><goal>shade</goal></goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
