<?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>
        <groupId>uk.gov.gchq.gaffer</groupId>
        <artifactId>road-traffic</artifactId>
        <version>0.7.2</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>road-traffic-demo</artifactId>
    <packaging>war</packaging>

    <properties>
        <standalone-path>/</standalone-path>
        <standalone-port>8080</standalone-port>
    </properties>

    <dependencies>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>road-traffic-rest</artifactId>
            <version>${project.parent.version}</version>
            <scope>provided</scope>
            <classifier>classes</classifier>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>${maven-war-plugin.version}</version>
                <configuration>
                    <attachClasses>true</attachClasses>
                    <classesClassifier>classes</classesClassifier>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>road-traffic-demo</id>
            <properties>
                <maven.test.skip>true</maven.test.skip>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.tomcat.maven</groupId>
                        <artifactId>tomcat7-maven-plugin</artifactId>
                        <version>2.0</version>
                        <configuration>
                            <path>${standalone-path}</path>
                            <port>${standalone-port}</port>
                            <webapps>
                                <webapp>
                                    <contextPath>/ui</contextPath>
                                    <groupId>uk.gov.gchq.gaffer</groupId>
                                    <artifactId>ui</artifactId>
                                    <version>${project.parent.version}</version>
                                    <type>war</type>
                                    <asWebapp>true</asWebapp>
                                </webapp>
                                <webapp>
                                    <contextPath>/rest</contextPath>
                                    <groupId>uk.gov.gchq.gaffer</groupId>
                                    <artifactId>road-traffic-rest</artifactId>
                                    <version>${project.parent.version}</version>
                                    <type>war</type>
                                    <asWebapp>true</asWebapp>
                                </webapp>
                            </webapps>
                            <systemProperties>
                                <gaffer.rest-api.basePath>rest/v1
                                </gaffer.rest-api.basePath>
                                <gaffer.schemas>
                                    ${project.parent.basedir}/road-traffic-model/src/main/resources/schema
                                </gaffer.schemas>
                                <gaffer.storeProperties>
                                    ${project.build.outputDirectory}/mockaccumulo.properties
                                </gaffer.storeProperties>
                                <roadTraffic.dataLoader.dataPath>
                                    ${project.build.outputDirectory}/roadTrafficSampleData.csv
                                </roadTraffic.dataLoader.dataPath>
                                <gaffer.error-mode.debug>
                                    false
                                </gaffer.error-mode.debug>
                            </systemProperties>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>uk.gov.gchq.gaffer</groupId>
                                <artifactId>road-traffic-rest</artifactId>
                                <version>${project.parent.version}</version>
                                <type>war</type>
                            </dependency>
                            <dependency>
                                <groupId>uk.gov.gchq.gaffer</groupId>
                                <artifactId>ui</artifactId>
                                <version>${project.parent.version}</version>
                                <type>war</type>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>deploy</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>run-war</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
