<?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>io.airlift</groupId>
        <artifactId>airbase</artifactId>
        <version>298</version>
    </parent>

    <artifactId>launcher</artifactId>
    <version>310</version>
    <packaging>pom</packaging>
    <name>launcher</name>
    <description>Launcher for Airlift-based Java applications</description>

    <scm>
        <connection>scm:git:git://github.com/airlift/launcher.git</connection>
        <developerConnection>scm:git:git@github.com:airlift/launcher.git</developerConnection>
        <tag>310</tag>
        <url>https://github.com/airlift/launcher</url>
    </scm>

    <properties>
        <air.main.basedir>${project.parent.basedir}</air.main.basedir>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.5.1</version>
                <executions>
                    <execution>
                        <id>build</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>compile</phase>
                        <configuration>
                            <executable>src/main/go/build.sh</executable>
                            <arguments>
                                <argument>${project.version}</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>test</phase>
                        <configuration>
                            <skip>${skipTests}</skip>
                            <workingDirectory>${project.basedir}/src/main/go</workingDirectory>
                            <executable>go</executable>
                            <arguments>
                                <argument>test</argument>
                                <argument>-v</argument>
                                <argument>-race</argument>
                                <argument>-parallel=10</argument>
                                <argument>-timeout=10s</argument>
                                <argument>./...</argument>
                            </arguments>
                            <environmentVariables>
                                <JAVA_HOME />
                            </environmentVariables>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>bin-tgz</id>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <attach>true</attach>
                            <descriptors>
                                <descriptor>src/main/assemblies/bin.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                    <execution>
                        <id>properties-tgz</id>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <attach>true</attach>
                            <descriptors>
                                <descriptor>src/main/assemblies/properties.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
