<?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>
    <parent>
        <groupId>studio.magemonkey</groupId>
        <artifactId>codex-parent</artifactId>
        <version>1.1.0-R1</version>
    </parent>

    <artifactId>codex</artifactId>
    <name>CodexCore</name>
    <description>The core plugin for MageMonkeyStudio plugins</description>

    <properties>
        <outputDir>../../build</outputDir>
    </properties>

    <dependencies>
        <dependency>
            <groupId>studio.magemonkey</groupId>
            <artifactId>codex-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>studio.magemonkey</groupId>
            <artifactId>codex-bungee</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>net.kyori</groupId>
            <artifactId>adventure-api</artifactId>
            <version>4.19.0</version>
        </dependency>
        <dependency>
            <groupId>net.kyori</groupId>
            <artifactId>adventure-platform-bukkit</artifactId>
            <version>4.3.4</version>
        </dependency>
    </dependencies>

    <build>
        <finalName>codex-${project.version}</finalName>
        <plugins>
            <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>
                    <outputDirectory>${outputDir}</outputDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <configuration>
                    <createDependencyReducedPom>false</createDependencyReducedPom>
                    <shadedArtifactAttached>false</shadedArtifactAttached>
                    <artifactSet>
                        <includes>
                            <include>${project.groupId}:codex-*</include>
                            <include>net.kyori:*</include>
                        </includes>
                    </artifactSet>
                    <filters>
                        <filter>
                            <artifact>${project.groupId}:codex-*</artifact>
                            <excludes>
                                <exclude>META-INF/MANIFEST.MF</exclude>
                                <exclude>LICENSE</exclude>
                            </excludes>
                        </filter>
                    </filters>
                    <relocations>
                        <relocation>
                            <pattern>net.kyori</pattern>
                            <shadedPattern>studio.magemonkey.codex.adventure</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>