<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>org.spigotmc</groupId>
    <artifactId>spigot</artifactId>
    <packaging>jar</packaging>
    <version>1.21.11-R0.2-SNAPSHOT</version>
    <name>Spigot</name>
    <url>https://www.spigotmc.org/</url>

    <parent>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot-parent</artifactId>
        <version>dev-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <properties>
        <skipTests>true</skipTests>
        <groups>AllFeatures,Bundle,Legacy,Normal,VanillaFeature</groups>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <api.version>unknown</api.version>
        <bt.name>git</bt.name>
        <minecraft_version>1_21_R7</minecraft_version>
        <maven.compiler.release>21</maven.compiler.release>
    </properties>

    <repositories>
        <repository>
            <id>minecraft-libraries</id>
            <name>Minecraft Libraries</name>
            <url>https://libraries.minecraft.net/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>${project.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>minecraft-server</artifactId>
            <version>${project.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.jline</groupId>
            <artifactId>jline</artifactId>
            <version>3.30.4</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-iostreams</artifactId>
            <version>2.24.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm-commons</artifactId>
            <version>9.8</version>
            <scope>compile</scope>
        </dependency>
        <!-- Start Mojang depends -->
        <dependency>
            <groupId>at.yawk.lz4</groupId>
            <artifactId>lz4-java</artifactId>
            <version>1.8.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.azure</groupId>
            <artifactId>azure-json</artifactId>
            <version>1.4.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.github.oshi</groupId>
            <artifactId>oshi-core</artifactId>
            <version>6.9.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>msal4j</artifactId>
            <version>1.23.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>authlib</artifactId>
            <version>7.0.61</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>brigadier</artifactId>
            <version>1.3.10</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>datafixerupper</artifactId>
            <version>9.0.19</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>jtracy</artifactId>
            <version>1.0.37</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>logging</artifactId>
            <version>1.6.11</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.20.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-buffer</artifactId>
            <version>4.2.7.Final</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-codec-base</artifactId>
            <version>4.2.7.Final</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-codec-compression</artifactId>
            <version>4.2.7.Final</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-codec-http</artifactId>
            <version>4.2.7.Final</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-common</artifactId>
            <version>4.2.7.Final</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-handler</artifactId>
            <version>4.2.7.Final</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-resolver</artifactId>
            <version>4.2.7.Final</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport</artifactId>
            <version>4.2.7.Final</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-classes-epoll</artifactId>
            <version>4.2.7.Final</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-classes-kqueue</artifactId>
            <version>4.2.7.Final</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-native-epoll</artifactId>
            <version>4.2.7.Final</version>
            <classifier>linux-x86_64</classifier>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-native-epoll</artifactId>
            <version>4.2.7.Final</version>
            <classifier>linux-aarch_64</classifier>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-native-kqueue</artifactId>
            <version>4.2.7.Final</version>
            <classifier>osx-x86_64</classifier>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-native-kqueue</artifactId>
            <version>4.2.7.Final</version>
            <classifier>osx-aarch_64</classifier>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-native-unix-common</artifactId>
            <version>4.2.7.Final</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>it.unimi.dsi</groupId>
            <artifactId>fastutil</artifactId>
            <version>8.5.18</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna</artifactId>
            <version>5.17.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna-platform</artifactId>
            <version>5.17.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>net.sf.jopt-simple</groupId>
            <artifactId>jopt-simple</artifactId>
            <version>5.0.4</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.19.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>2.25.2</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.25.2</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j2-impl</artifactId>
            <version>2.25.2</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.jspecify</groupId>
            <artifactId>jspecify</artifactId>
            <version>1.0.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.17</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.2</version>
            <scope>compile</scope>
        </dependency>
        <!-- End Mojang depends -->
        <!-- deprecated API depend -->
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
            <scope>compile</scope>
        </dependency>
        <!-- deprecated API depend -->
        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>1.1.1</version>
            <scope>runtime</scope>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.xerial</groupId>
            <artifactId>sqlite-jdbc</artifactId>
            <version>3.49.1.0</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.mysql</groupId>
            <artifactId>mysql-connector-j</artifactId>
            <version>9.2.0</version>
            <scope>runtime</scope>
        </dependency>
        <!-- add these back in as they are not exposed by the API -->
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-resolver-provider</artifactId>
            <version>3.9.6</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.resolver</groupId>
            <artifactId>maven-resolver-connector-basic</artifactId>
            <version>1.9.18</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.resolver</groupId>
            <artifactId>maven-resolver-transport-http</artifactId>
            <version>1.9.18</version>
            <scope>runtime</scope>
        </dependency>
        <!-- annotations -->
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations-java5</artifactId>
            <version>24.1.0</version>
            <scope>provided</scope>
        </dependency>
        <!-- testing -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.10.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-suite-engine</artifactId>
            <version>1.10.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <version>2.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>5.19.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm-tree</artifactId>
            <version>9.8</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <!-- This builds a completely 'ready to start' jar with all dependencies inside -->
    <build>
        <plugins>
            <plugin>
                <groupId>net.md-5</groupId>
                <artifactId>scriptus</artifactId>
                <version>0.5.0</version>
                <executions>
                    <execution>
                        <id>ex-spigot</id>
                        <configuration>
                            <format>${bt.name}-Spigot-%s</format>
                            <scmDirectory>../</scmDirectory>
                            <descriptionProperty>spigot.desc</descriptionProperty>
                        </configuration>
                        <phase>initialize</phase>
                        <goals>
                            <goal>describe</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>ex-craftbukkit</id>
                        <configuration>
                            <format>-%s</format>
                            <scmDirectory>../../CraftBukkit</scmDirectory>
                            <descriptionProperty>craftbukkit.desc</descriptionProperty>
                        </configuration>
                        <phase>initialize</phase>
                        <goals>
                            <goal>describe</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <phase>initialize</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.4.1</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultEntries>false</addDefaultEntries>
                        </manifest>
                        <manifestEntries>
                            <Main-Class>org.bukkit.craftbukkit.Main</Main-Class>
                            <Implementation-Title>CraftBukkit</Implementation-Title>
                            <Implementation-Version>${spigot.desc}${craftbukkit.desc}</Implementation-Version>
                            <Implementation-Vendor>${project.build.outputTimestamp}</Implementation-Vendor>
                            <Specification-Title>Bukkit</Specification-Title>
                            <Specification-Version>${api.version}</Specification-Version>
                            <Specification-Vendor>Bukkit Team</Specification-Vendor>
                            <Multi-Release>true</Multi-Release>
                        </manifestEntries>
                        <manifestSections>
                            <manifestSection>
                                <name>net/bukkit/</name>
                                <manifestEntries>
                                    <Sealed>true</Sealed>
                                </manifestEntries>
                            </manifestSection>
                            <manifestSection>
                                <name>com/bukkit/</name>
                                <manifestEntries>
                                    <Sealed>true</Sealed>
                                </manifestEntries>
                            </manifestSection>
                            <manifestSection>
                                <name>org/bukkit/</name>
                                <manifestEntries>
                                    <Sealed>true</Sealed>
                                </manifestEntries>
                            </manifestSection>
                        </manifestSections>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.5.3</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createSourcesJar>${shadeSourcesJar}</createSourcesJar>
                            <artifactSet>
                                <includes>
                                    <include>org.spigotmc:minecraft-server</include>
                                </includes>
                            </artifactSet>
                            <relocations>
                                <relocation>
                                    <pattern>org.bukkit.craftbukkit</pattern>
                                    <shadedPattern>org.bukkit.craftbukkit.v${minecraft_version}</shadedPattern>
                                    <excludes>
                                        <exclude>org.bukkit.craftbukkit.bootstrap.*</exclude>
                                        <exclude>org.bukkit.craftbukkit.Main*</exclude>
                                    </excludes>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.md-5</groupId>
                <artifactId>specialsource-maven-plugin</artifactId>
                <version>2.0.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>remap</goal>
                        </goals>
                        <id>remap-obf</id>
                        <configuration>
                            <useProjectDependencies>false</useProjectDependencies>
                            <srgIn>org.spigotmc:minecraft-server:${project.version}:txt:maps-mojang</srgIn>
                            <reverse>true</reverse>
                            <remappedArtifactAttached>true</remappedArtifactAttached>
                            <remappedClassifierName>remapped-obf</remappedClassifierName>
                        </configuration>
                    </execution>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>remap</goal>
                        </goals>
                        <id>remap-spigot</id>
                        <configuration>
                            <useProjectDependencies>false</useProjectDependencies>
                            <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
                            <srgIn>org.spigotmc:minecraft-server:${project.version}:csrg:maps-spigot</srgIn>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.nicoulaj.maven.plugins</groupId>
                <artifactId>checksum-maven-plugin</artifactId>
                <version>1.11</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>artifacts</goal>
                            <goal>dependencies</goal>
                        </goals>
                        <configuration>
                            <algorithms>
                                <algorithm>SHA-256</algorithm>
                            </algorithms>
                            <excludeClassifiers>remapped-obf</excludeClassifiers>
                            <quiet>true</quiet>
                            <scopes>
                                <scope>compile</scope>
                                <scope>runtime</scope>
                            </scopes>
                            <shasumSummary>true</shasumSummary>
                            <transitive>true</transitive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.7.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <archive>
                                <manifest>
                                    <addDefaultEntries>false</addDefaultEntries>
                                </manifest>
                                <manifestEntries>
                                    <Main-Class>org.bukkit.craftbukkit.bootstrap.Main</Main-Class>
                                </manifestEntries>
                            </archive>
                            <attach>false</attach>
                            <descriptors>
                                <descriptor>${project.basedir}/src/assembly/bootstrap.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <!-- default changed with version 3.11.0 -->
                    <showWarnings>false</showWarnings>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.2.5</version>
                <configuration>
                    <workingDirectory>${basedir}/target/test-server</workingDirectory>
                    <reuseForks>false</reuseForks>
                    <includes>
                        <include>**/*TestSuite.java</include>
                    </includes>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>shadeSourcesJar</id>
            <properties>
                <shadeSourcesJar>true</shadeSourcesJar>
                <shadeSourcesContent>true</shadeSourcesContent>
            </properties>
        </profile>
        <profile>
            <id>development</id>
            <properties>
                <skipTests>false</skipTests>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <version>3.6.0</version>
                        <executions>
                            <execution>
                                <phase>test-compile</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configLocation>checkstyle.xml</configLocation>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>com.puppycrawl.tools</groupId>
                                <artifactId>checkstyle</artifactId>
                                <version>8.45.1</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>remapped</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.md-5</groupId>
                        <artifactId>specialsource-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>remap</goal>
                                </goals>
                                <id>remap-mojang</id>
                                <configuration>
                                    <useProjectDependencies>false</useProjectDependencies>
                                    <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
                                    <srgIn>org.spigotmc:minecraft-server:${project.version}:txt:maps-mojang</srgIn>
                                    <remappedArtifactAttached>true</remappedArtifactAttached>
                                    <remappedClassifierName>remapped-mojang</remappedClassifierName>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
