<?xml version="1.0"?>
<!--
  ~ Copyright 2010-2018 Norwegian Agency for Public Management and eGovernment (Difi)
  ~
  ~ Licensed under the EUPL, Version 1.1 or – as soon they
  ~ will be approved by the European Commission - subsequent
  ~ versions of the EUPL (the "Licence");
  ~
  ~ You may not use this work except in compliance with the Licence.
  ~
  ~ You may obtain a copy of the Licence at:
  ~
  ~ https://joinup.ec.europa.eu/community/eupl/og_page/eupl
  ~
  ~ Unless required by applicable law or agreed to in
  ~ writing, software distributed under the Licence is
  ~ distributed on an "AS IS" basis,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  ~ express or implied.
  ~ See the Licence for the specific language governing
  ~ permissions and limitations under the Licence.
  -->

<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>
        <artifactId>oxalis</artifactId>
        <groupId>network.oxalis</groupId>
        <version>5.1.0</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <artifactId>oxalis-distribution</artifactId>
    <packaging>pom</packaging>

    <name>Oxalis :: Dist :: Distribution</name>
    <description>Creates a complete distribution which may be uploaded and made available.</description>
    <url>https://github.com/OxalisCommunity/oxalis</url>

    <issueManagement>
        <url>https://github.com/OxalisCommunity/oxalis/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <organization>
        <name>NorStella</name>
        <url>https://en.norstella.no/</url>
    </organization>

    <dependencies>
        <dependency>
            <groupId>network.oxalis</groupId>
            <artifactId>oxalis-standalone</artifactId>
        </dependency>
        <dependency>
            <groupId>network.oxalis</groupId>
            <artifactId>oxalis-statistics</artifactId>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>dist</id>

            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <configuration>
                            <!-- Where to place the generated .zip and tar.gz files -->
                            <outputDirectory>target</outputDirectory>
                            <descriptors>
                                <descriptor>src/main/assembly/distribution.xml</descriptor>
                            </descriptors>
                        </configuration>
                        <executions>
                            <execution>
                                <id>make-distribution</id>
                                <!-- this is used for inheritance merges -->
                                <phase>package</phase>
                                <!-- bind to the packaging phase -->
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-resources</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>../../target/distribution</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>${project.build.directory}/${project.build.finalName}-distro
                                            </directory>
                                            <filtering>false</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>

        </profile>
    </profiles>

</project>
