<?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>com.github.rremer</groupId>
        <artifactId>minecraft-modpack-steampunk</artifactId>
        <version>1.18.2-1</version>
    </parent>

    <groupId>com.github.rremer</groupId>
    <artifactId>minecraft-modpack-steampunk-server</artifactId>
    <version>1.18.2-1</version>
    <packaging>jar</packaging>

    <name>Minecraft Modpack Steampunk Server</name>
    <description>Server and mods and configurations for a Steampunk Minecraft modpack.</description>

    <properties>
        <github.site.location>${project.version}/${project.artifactId}</github.site.location>
        <minecraft.allow-flight>true</minecraft.allow-flight>
        <minecraft.difficulty>hard</minecraft.difficulty>
        <minecraft.level-seed></minecraft.level-seed>
        <minecraft.message-of-the-day></minecraft.message-of-the-day>
        <minecraft.snooper-enabled>true</minecraft.snooper-enabled>

        <parameter.fabric.installer.mode>server</parameter.fabric.installer.mode>

        <server.gcOptions>-XX:+UseG1GC</server.gcOptions>
        <server.xmsGB>4</server.xmsGB>
        <server.xmxGB>12</server.xmxGB>

        <url.datapacks.target>${project.build.directory}/datapacks</url.datapacks.target>
        <url.fabric.launcherName>fabric-server-launch.jar</url.fabric.launcherName>
        <url.installer.target>${project.build.directory}/server</url.installer.target>
        <url.mods.target>${project.build.directory}/mods</url.mods.target>

        <version.maven-dependency-plugin>3.1.2</version.maven-dependency-plugin>
    </properties>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>minecraft-modpack-steampunk-datapack-gamerules</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>minecraft-modpack-steampunk-datapack-recipes</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>minecraft-modpack-steampunk-datapack-starting-inventory</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/resources/filtered</directory>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>com.googlecode.maven-download-plugin</groupId>
                <artifactId>download-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>fabric-installer</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>fabric-api</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>create</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>lithium</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>carpet</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>carpet-extra</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>rei-architectury</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>rei</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>rer</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>fast-leaf-decay</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>immersive-portals</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>spice-of-life</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>croptopia</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>patchouli</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>graves</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>natures-compass</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>waystones-balm</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>waystones</id>
                        <phase>generate-sources</phase>
                    </execution>
                    <execution>
                        <id>backup</id>
                        <phase>generate-sources</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>server</id>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <descriptor>src/assembly/server.xml</descriptor>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${version.maven-dependency-plugin}</version>
                <executions>
                    <execution>
                        <id>datapacks</id>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>minecraft-modpack-steampunk-datapack-recipes</artifactId>
                                    <version>${project.version}</version>
                                    <type>zip</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${url.datapacks.target}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>minecraft-modpack-steampunk-datapack-gamerules</artifactId>
                                    <version>${project.version}</version>
                                    <type>zip</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${url.datapacks.target}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>minecraft-modpack-steampunk-datapack-starting-inventory</artifactId>
                                    <version>${project.version}</version>
                                    <type>zip</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${url.datapacks.target}</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.basepom.maven</groupId>
                <artifactId>duplicate-finder-maven-plugin</artifactId>
                <configuration>
                    <ignoredDependencies>
                        <dependency>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>minecraft-modpack-steampunk-datapack-gamerules</artifactId>
                        </dependency>
                        <dependency>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>minecraft-modpack-steampunk-datapack-recipes</artifactId>
                        </dependency>
                        <dependency>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>minecraft-modpack-steampunk-datapack-starting-inventory</artifactId>
                        </dependency>
                    </ignoredDependencies>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>fabric-installer</id>
                        <phase>compile</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
