<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.graphfoundation.ongdb</groupId>
        <artifactId>parent</artifactId>
        <version>3.6.0</version>
        <relativePath>../..</relativePath>
    </parent>

    <groupId>org.graphfoundation.ongdb.assembly</groupId>
    <artifactId>ongdb-standalone</artifactId>
    <packaging>pom</packaging>

    <name>ONgDB - Server Assembler</name>
    <description>This project assembles the Neo4j stand-alone distribution,
        pulling together all the deliverable artifacts and packaging them
        into a downloadable installer.
    </description>
    <url>https://ongdb.graphfoundation.org/${project.artifactId}/${project.version}</url>

    <scm>
        <connection>scm:git:git://github.com/graphfoundation/ongdb.git</connection>
        <developerConnection>scm:git:git@github.com:graphfoundation/ongdb.git</developerConnection>
        <url>https://github.com/graphfoundation/ongdb</url>
    </scm>

    <modules>
        <module>standalone-community</module>
        <module>standalone-enterprise</module>
    </modules>

    <properties>
        <license-text.header>headers/AGPL-3-header.txt</license-text.header>
        <!-- other filter properties -->
        <neo4j.version>${project.version}</neo4j.version>

        <!-- conf/neo4j.conf filter properties -->
        <default.http.port>7474</default.http.port>
        <default.https.port>7473</default.https.port>
        <org.neo4j.webservice.packages>org.neo4j.rest.web</org.neo4j.webservice.packages>

        <!-- Runtime properties. These are used to bootstrap the server. All other configuration should happen through a configuration file. Each of these should have a sensible default, so that the server can operate without them defined. -->
        <neo4j.home>${project.build.directory}/neo4j</neo4j.home>
        <neo4j.confdir>${neo4j.home}/conf</neo4j.confdir> <!-- needed? -->
        <neo4j.datadir>${neo4j.home}/data</neo4j.datadir> <!-- needed? -->
        <neo4j.logdir>${neo4j.datadir}/log</neo4j.logdir> <!-- needed? -->
        <skip.shell.tests>false</skip.shell.tests>
    </properties>

    <licenses>
        <license>
            <name>GNU Affero General Public License, Version 3</name>
            <url>http://www.gnu.org/licenses/agpl-3.0-standalone.html</url>
        </license>
    </licenses>

    <build>
        <plugins>
            <plugin>
                <inherited>false</inherited>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-shell</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <ant antfile="${project.basedir}/build.xml" inheritRefs="true"/>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.neo4j.build.plugins</groupId>
                <artifactId>licensing-maven-plugin</artifactId>
                <configuration>
                    <prependText>licensing/notice-agpl-prefix.txt</prependText>
                    <excludedGroups>
                        ^((org.graphfoundation.ongdb){1}|(org.graphfoundation.ongdb.app){1}|(org.graphfoundation.ongdb.server.plugin){1}|(org.graphfoundation.ongdb.assembly){1})$
                    </excludedGroups>
                </configuration>
                <executions>
                    <execution>
                        <id>list-all-licenses</id>
                        <configuration>
                            <licensingRequirementFiles combine.children="append">
                                <licensingRequirementFile>licensing/licensing-requirements-browser.xml</licensingRequirementFile>
                            </licensingRequirementFiles>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>shell-script-tests</id>
                        <phase>test</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <inherited>false</inherited>
                        <configuration>
                            <skip>${skip.shell.tests}</skip>
                            <executable>./run-tests.sh</executable>
                            <workingDirectory>src/tests/shell-scripts</workingDirectory>
                            <arguments>
                                <argument>--verbose</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.graphfoundation.ongdb</groupId>
            <artifactId>ongdb-import-tool</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- Defined to allow maven to calculate build order, it's used in the plugin above -->
        <dependency>
            <groupId>org.graphfoundation.ongdb.build</groupId>
            <artifactId>build-resources</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>disable-shell-script-tests</id>
            <activation>
                <os>
                    <family>windows</family>
                </os>
            </activation>
            <properties>
                <skip.shell.tests>true</skip.shell.tests>
            </properties>
        </profile>
        <profile>
            <id>skip-shell-script-tests</id>
            <activation>
                <property>
                    <name>skipTests</name>
                </property>
            </activation>
            <properties>
                <skip.shell.tests>true</skip.shell.tests>
            </properties>
        </profile>
    </profiles>
</project>
