<?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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <artifactId>graphhopper-web-bundle</artifactId>
    <packaging>jar</packaging>
    <version>3.2</version>
    <name>GraphHopper Dropwizard Bundle</name>
    <description>Use the GraphHopper routing engine as a web-service</description>

    <parent>
        <groupId>com.graphhopper</groupId>
        <artifactId>graphhopper-parent</artifactId>
        <version>3.2</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>com.graphhopper</groupId>
            <artifactId>graphhopper-web-api</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>com.graphhopper</groupId>
            <artifactId>graphhopper-core</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>com.graphhopper</groupId>
            <artifactId>graphhopper-reader-gtfs</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>com.graphhopper</groupId>
            <artifactId>graphhopper-map-matching</artifactId>
            <version>${project.parent.version}</version>
        </dependency>

        <!-- required for JDK9 -->
        <dependency>
            <groupId>javax.xml.ws</groupId>
            <artifactId>jaxws-api</artifactId>
            <version>2.3.1</version>
        </dependency>
        <!-- required for dropwizard -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-core</artifactId>
        </dependency>
        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-client</artifactId>
        </dependency>
        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-testing</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.wdtinc</groupId>
            <artifactId>mapbox-vector-tile</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-xml-provider</artifactId>
        </dependency>

        <!-- Pt and/or map-matching and/or isochrone web client dependencies-->
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>react</artifactId>
            <version>16.10.2</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>react-dom</artifactId>
            <version>16.10.2</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>leaflet</artifactId>
            <version>1.5.1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>momentjs</artifactId>
            <version>2.24.0</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery</artifactId>
            <version>2.2.3</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>mapbox-gl</artifactId>
            <!-- this was the last mapbox release with an open license, the license was changed for 2.0+ -->
            <version>1.13.0</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>vue</artifactId>
            <version>2.6.12</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>papaparse</artifactId>
            <version>5.2.0</version>
        </dependency>

        <!-- for integration tests of service -->
        <dependency>
            <groupId>com.graphhopper</groupId>
            <artifactId>directions-api-client-hc</artifactId>
            <version>${project.parent.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>1.10.0</version>
                <executions>
                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <configuration>
                            <nodeVersion>v12.3.1</nodeVersion>
                            <npmVersion>6.14.5</npmVersion>
                        </configuration>
                    </execution>
                    <execution>
                        <id>install custom model editor</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>install</arguments>
                            <workingDirectory>src/main/js/custom-model-editor</workingDirectory>
                            <installDirectory>${project.basedir}</installDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>build custom model editor</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>run build</arguments>
                            <workingDirectory>src/main/js/custom-model-editor</workingDirectory>
                            <installDirectory>${project.basedir}</installDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>install</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm run bundleProduction</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <phase>generate-resources</phase>
                        <configuration>
                            <arguments>run bundleProduction</arguments>
                            <environmentVariables>
                                <BROWSERIFYSWAP_ENV>development</BROWSERIFYSWAP_ENV>
                            </environmentVariables>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>


