<?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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>spigot-parent</artifactId>
    <groupId>org.spigotmc</groupId>
    <version>dev-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.spigotmc</groupId>
  <artifactId>spigot</artifactId>
  <name>Spigot</name>
  <version>1.16.5-R0.1-SNAPSHOT</version>
  <url>https://www.spigotmc.org/</url>
  <build>
    <plugins>
      <plugin>
        <groupId>net.md-5</groupId>
        <artifactId>scriptus</artifactId>
        <version>0.4.1</version>
        <executions>
          <execution>
            <id>ex-spigot</id>
            <phase>initialize</phase>
            <goals>
              <goal>describe</goal>
            </goals>
            <configuration>
              <format>${bt.name}-Spigot-%s</format>
              <scmDirectory>../</scmDirectory>
              <descriptionProperty>spigot.desc</descriptionProperty>
            </configuration>
          </execution>
          <execution>
            <id>ex-craftbukkit</id>
            <phase>initialize</phase>
            <goals>
              <goal>describe</goal>
            </goals>
            <configuration>
              <format>-%s</format>
              <scmDirectory>../../CraftBukkit</scmDirectory>
              <descriptionProperty>craftbukkit.desc</descriptionProperty>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.2.0</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>
            </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>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.3</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createSourcesJar>${shadeSourcesJar}</createSourcesJar>
              <filters>
                <filter>
                  <artifact>org.spigotmc:minecraft-server</artifact>
                  <excludes>
                    <exclude>com/google/common/**</exclude>
                    <exclude>com/google/gson/**</exclude>
                    <exclude>com/google/thirdparty/**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.eclipse.sisu:org.eclipse.sisu.inject</artifact>
                  <excludes>
                    <exclude>META-INF/services/javax.annotation.processing.Processor</exclude>
                  </excludes>
                </filter>
              </filters>
              <relocations>
                <relocation>
                  <pattern>jline</pattern>
                  <shadedPattern>org.bukkit.craftbukkit.libs.jline</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>it.unimi</pattern>
                  <shadedPattern>org.bukkit.craftbukkit.libs.it.unimi</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.commons.codec</pattern>
                  <shadedPattern>org.bukkit.craftbukkit.libs.org.apache.commons.codec</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.commons.io</pattern>
                  <shadedPattern>org.bukkit.craftbukkit.libs.org.apache.commons.io</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.commons.lang3</pattern>
                  <shadedPattern>org.bukkit.craftbukkit.libs.org.apache.commons.lang3</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.http</pattern>
                  <shadedPattern>org.bukkit.craftbukkit.libs.org.apache.http</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.maven</pattern>
                  <shadedPattern>org.bukkit.craftbukkit.libs.org.apache.maven</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.codehaus.plexus</pattern>
                  <shadedPattern>org.bukkit.craftbukkit.libs.org.codehaus.plexus</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.eclipse.aether</pattern>
                  <shadedPattern>org.bukkit.craftbukkit.libs.org.eclipse.aether</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.eclipse.sisu</pattern>
                  <shadedPattern>org.bukkit.craftbukkit.libs.org.eclipse.sisu</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.objectweb.asm</pattern>
                  <shadedPattern>org.bukkit.craftbukkit.libs.org.objectweb.asm</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.bukkit.craftbukkit</pattern>
                  <shadedPattern>org.bukkit.craftbukkit.v${minecraft_version}</shadedPattern>
                  <excludes>
                    <exclude>org.bukkit.craftbukkit.Main*</exclude>
                  </excludes>
                </relocation>
                <relocation>
                  <pattern>com/mojang/math/(.+/)*(.*)</pattern>
                  <shadedPattern>net/minecraft/server/v${minecraft_version}/$2</shadedPattern>
                  <rawString>true</rawString>
                </relocation>
                <relocation>
                  <pattern>net/minecraft/(.+/)*(.*)</pattern>
                  <shadedPattern>net/minecraft/server/v${minecraft_version}/$2</shadedPattern>
                  <rawString>true</rawString>
                </relocation>
              </relocations>
              <transformers>
                <transformer>
                  <resource>META-INF/services/java.sql.Driver</resource>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-compiler-eclipse</artifactId>
            <version>2.8.8</version>
          </dependency>
          <dependency>
            <groupId>org.eclipse.jdt</groupId>
            <artifactId>ecj</artifactId>
            <version>3.24.0</version>
          </dependency>
        </dependencies>
        <configuration>
          <compilerId>eclipse</compilerId>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.12.4</version>
        <configuration>
          <workingDirectory>${basedir}/target/test-server</workingDirectory>
          <excludes>
            <exclude>org/bukkit/craftbukkit/inventory/ItemStack*Test.java</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>shadeSourcesJar</id>
      <properties>
        <shadeSourcesContent>true</shadeSourcesContent>
        <shadeSourcesJar>true</shadeSourcesJar>
      </properties>
    </profile>
    <profile>
      <id>development</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <version>3.1.1</version>
            <executions>
              <execution>
                <phase>process-classes</phase>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>com.puppycrawl.tools</groupId>
                <artifactId>checkstyle</artifactId>
                <version>8.39</version>
              </dependency>
            </dependencies>
            <configuration>
              <configLocation>checkstyle.xml</configLocation>
              <includeTestSourceDirectory>true</includeTestSourceDirectory>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>animal-sniffer-maven-plugin</artifactId>
            <version>1.19</version>
            <executions>
              <execution>
                <phase>process-classes</phase>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <signature>
                <groupId>org.codehaus.mojo.signature</groupId>
                <artifactId>java18</artifactId>
                <version>1.0</version>
              </signature>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <skipTests>false</skipTests>
      </properties>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <version>1.3</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <properties>
    <api.version>unknown</api.version>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.source>1.8</maven.compiler.source>
    <bt.name>git</bt.name>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <minecraft.version>1.16.5</minecraft.version>
    <skipTests>true</skipTests>
    <minecraft_version>1_16_R3</minecraft_version>
  </properties>
</project>
