<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>org.igniterealtime.spark</groupId>
        <artifactId>parent</artifactId>
        <version>3.0.3-SNAPSHOT</version>
    </parent>

    <artifactId>distribution</artifactId>

    <name>Spark Distribution</name>

    <build>
        <finalName>distribution</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <descriptors>
                        <descriptor>src/assembly/basic-distribution.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>install4j</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.install4j</groupId>
                        <artifactId>install4j-maven-plugin</artifactId>
                        <version>1.1.1</version>

                        <executions>
                            <execution>
                                <id>compile-installers</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                                <configuration>
                                    <projectFile>${project.basedir}/src/installer/spark.install4j</projectFile>
                                    <variables>
                                        <sys.version>${project.version}</sys.version>
                                        <maven-build-directory>${project.build.directory}</maven-build-directory>
                                    </variables>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>
</project>
