<?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>arma3launcher</artifactId>
        <groupId>de.mc8051</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>dist</artifactId>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>default-jar</id>
                        <phase>none</phase>
                        <configuration>
                            <finalName>unwanted</finalName>
                            <classifier>unwanted</classifier>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.6.0</version>
                <executions>
                    <execution>
                        <id>make-exe</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>

                        <configuration>
                            <executable>java</executable>
                            <outputFile>target/packr-exec.log</outputFile>
                            <workingDirectory>./</workingDirectory>
                            <arguments>
                                <argument>-jar</argument>
                                <argument>packr.jar</argument>
                                <argument>--platform</argument>
                                <argument>windows64</argument>
                                <argument>--jdk</argument>
                                <argument>src/main/resources/jre.zip</argument>
                                <argument>--executable</argument>
                                <argument>${project.parent.artifactId}</argument>
                                <argument>--output</argument>
                                <argument>target/launcher/</argument>
                                <argument>--mainclass</argument>
                                <argument>${project.parent.groupId}.${project.parent.artifactId}.ArmA3Launcher</argument>
                                <argument>--classpath</argument>
                                <argument>${project.parent.artifactId}-gui.jar</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>dist</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <finalName>${project.parent.artifactId}</finalName>
                            <appendAssemblyId>false</appendAssemblyId>
                            <descriptors>
                                <descriptor>src/main/zip.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>