<?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">
    <parent>
        <artifactId>ExcellentEnchants</artifactId>
        <groupId>su.nightexpress.excellentenchants</groupId>
        <version>5.4.3</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>Core</artifactId>

    <properties>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <repositories>
        <repository>
            <id>placeholderapi</id>
            <url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>io.papermc.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>26.1.2.build.51-beta</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>me.clip</groupId>
            <artifactId>placeholderapi</artifactId>
            <version>2.11.6</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>su.nightexpress.excellentenchants</groupId>
            <artifactId>API</artifactId>
            <version>5.4.3</version>
        </dependency>

        <dependency>
            <groupId>su.nightexpress.excellentenchants</groupId>
            <artifactId>spigot-1.21.11</artifactId>
            <version>5.4.3</version>
        </dependency>

        <dependency>
            <groupId>su.nightexpress.excellentenchants</groupId>
            <artifactId>spigot-26.1.2</artifactId>
            <version>5.4.3</version>
        </dependency>

        <dependency>
            <groupId>su.nightexpress.excellentenchants</groupId>
            <artifactId>MC_1_21_10</artifactId>
            <version>5.4.3</version>
        </dependency>

        <dependency>
            <groupId>su.nightexpress.excellentenchants</groupId>
            <artifactId>MC_1_21_8</artifactId>
            <version>5.4.3</version>
        </dependency>

        <dependency>
            <groupId>su.nightexpress.excellentenchants</groupId>
            <artifactId>tooltip-packetevents</artifactId>
            <version>5.4.3</version>
        </dependency>

        <dependency>
            <groupId>su.nightexpress.excellentenchants</groupId>
            <artifactId>tooltip-protocollib</artifactId>
            <version>5.4.3</version>
        </dependency>

        <dependency>
            <groupId>su.nightexpress.excellentenchants</groupId>
            <artifactId>compat-mythicmobs</artifactId>
            <version>5.4.3</version>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory> <!-- (your resources folder location) -->
                <filtering>true</filtering> <!-- this is the important part, it's what replaces, filters, all placeholders in the resources folder (such as ${project.version} in plugin.yml) -->
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Force PaperMC to remap the plugin to paper mappings, but keep Spigot compatibility -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.4.2</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <paperweight-mappings-namespace>spigot</paperweight-mappings-namespace>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <!-- Java 16 Fix -->
                <dependencies>
                    <dependency>
                        <groupId>org.ow2.asm</groupId>
                        <artifactId>asm</artifactId>
                        <version>9.2</version>
                    </dependency>
                    <dependency>
                        <groupId>org.ow2.asm</groupId>
                        <artifactId>asm-commons</artifactId>
                        <version>9.2</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <outputFile>${project.parent.basedir}/target/${project.parent.name}-${project.version}.jar</outputFile>
                            <artifactSet>
                                <includes>
                                    <include>su.nightexpress.excellentenchants*</include>
                                </includes>
                            </artifactSet>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
