<?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>1.5.2</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

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

    <properties>
        <store.type>accumulo</store.type>
        <standalone-path>rest</standalone-path>
        <standalone-port>8080</standalone-port>
    </properties>

    <dependencies>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>graph</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>accumulo-store</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>jcs-cache-service</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>road-traffic-model</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>road-traffic-rest</artifactId>
            <version>${project.parent.version}</version>
            <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>/</path>
                            <port>${standalone-port}</port>
                            <webapps>
                                <webapp>
                                    <contextPath>/${standalone-path}
                                    </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.properties.app.title>
                                    Road Traffic Example
                                </gaffer.properties.app.title>
                                <gaffer.properties.app.description>
                                    Example using road traffic data.
                                    The sample data used is taken from the
                                    Department for Transport
                                    &lt;a
                                    href='http://data.dft.gov.uk/gb-traffic-matrix/Raw_count_data_major_roads.zip'
                                    &gt;GB Road Traffic Counts&lt;/a&gt;,
                                    which is licensed under the
                                    &lt;a
                                    href='http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3'
                                    &gt;Open Government Licence&lt;/a&gt;.
                                </gaffer.properties.app.description>
                                <gaffer.properties.app.logo.link>
                                    https://github.com/gchq/Gaffer
                                </gaffer.properties.app.logo.link>
                                <gaffer.properties.app.logo.src>
                                    images/logo.png
                                </gaffer.properties.app.logo.src>
                                <gaffer.properties.app.logo.favicon.small>
                                    images/favicon-16x16.png
                                </gaffer.properties.app.logo.favicon.small>
                                <gaffer.properties.app.logo.favicon.large>
                                    images/favicon-32x32.png
                                </gaffer.properties.app.logo.favicon.large>
                                <gaffer.rest-api.basePath>
                                    ${standalone-path}
                                </gaffer.rest-api.basePath>
                                <gaffer.graph.config>
                                    ${project.build.outputDirectory}/graphConfig.json
                                </gaffer.graph.config>
                                <gaffer.schemas>
                                    ${project.parent.basedir}/road-traffic-model/src/main/resources/schema
                                </gaffer.schemas>
                                <gaffer.storeProperties>
                                    ${project.build.outputDirectory}/${store.type}/store.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>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>deploy</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>run-war</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
