<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>

  <name>r5</name>
  <description>Next-generation fast routing library for spatial analysis applications</description>
  <url>https://github.com/conveyal/r5</url>

  <groupId>com.conveyal</groupId>
  <artifactId>r5</artifactId>
  <version>2.2.0</version>
  <packaging>jar</packaging>

  <licenses>
    <license>
      <name>MIT</name>
      <url>https://opensource.org/licenses/MIT</url>
    </license>
  </licenses>

  <!-- Developer entries are provided for primary developers.
 For other contributors, see https://github.com/conveyal/r5/graphs/contributors -->
  <developers>
    <developer>
      <name>Matt Conway</name>
      <email>mconway@conveyal.com</email>
      <organization>Conveyal</organization>
      <organizationUrl>http://conveyal.com/</organizationUrl>
    </developer>
    <developer>
      <name>Andrew Byrd</name>
      <email>abyrd@conveyal.com</email>
      <organization>Conveyal</organization>
      <organizationUrl>http://conveyal.com/</organizationUrl>
    </developer>
    <developer>
      <name>Marko Burjek</name>
      <email></email>
      <organization>Kodanta</organization>
    </developer>
  </developers>

  <!-- Define where the source code for this project lives -->
  <scm>
    <connection>scm:git:https://github.com/conveyal/r5.git</connection>
    <developerConnection>scm:git:https://github.com/conveyal/r5.git</developerConnection>
    <url>https://github.com/conveyal/r5</url>
  </scm>

  <!-- Define some variables to be used elsewhere in the build. -->
  <properties>
    <geotools.version>14.0</geotools.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <!-- Define where the artifacts produced by this build will be deployed -->
  <distributionManagement>
    <!-- We are using Sonatype Nexus Staging instead of Maven Release plugin.
         Only a snapshot repo should be configured. Releases are done from that snapshot staging repo. -->
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <build>

    <resources>
      <resource>
        <!-- This allows Maven to substitute build and version details into a properties file for use at runtime. -->
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>**/*.properties</include>
          <include>worker.sh</include>
          <include>debug-plan/**</include>
          <include>fares/**</include>
        </includes>
      </resource>
    </resources>

    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <!-- use Java 8 -->
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>pl.project13.maven</groupId>
        <artifactId>git-commit-id-plugin</artifactId>
        <version>2.2.1</version>
        <executions>
          <execution>
            <goals>
              <goal>revision</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.2</version>
        <!-- Create a version of the JAR that includes all dependencies.
             We don't want this to be attached and deployed, but we'll have Travis upload it to S3. -->
        <executions>
            <execution>
              <phase>package</phase>
              <goals><goal>shade</goal></goals>
              <configuration>
                <!-- Name the shaded JAR after the git describe string. This makes it uniquely identifiable so we can
                     run analysis workers with a specific commit or tag of R5. The shaded JAR is not "attached" to
                     deployments because this will cause it to be renamed to the standard timestamped name and sorted
                     into a Maven repo directory by version number. -->
                <finalName>${git.commit.id.describe}</finalName>
                <transformers>
                  <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                    <manifestEntries>
                      <Main-Class>com.conveyal.r5.R5Main</Main-Class>
                    </manifestEntries>
                  </transformer>
                  <!-- files overwrite each other and geotools does not function without this.
                       http://docs.geotools.org/latest/userguide/faq.html#how-do-i-create-an-executable-jar-for-my-geotools-app -->
                  <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                </transformers>
                <!-- signature files from included jars cause problems: http://stackoverflow.com/questions/999489 -->
                <filters>
                  <filter>
                    <artifact>*:*</artifact>
                    <excludes>
                      <exclude>META-INF/*.SF</exclude>
                      <exclude>META-INF/*.DSA</exclude>
                      <exclude>META-INF/*.RSA</exclude>
                    </excludes>
                  </filter>
                </filters>
              </configuration>
            </execution>
        </executions>
      </plugin>

      <plugin>
        <!-- Recommended way to deploy to OSSRH -->
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.7</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <!-- Release versions will be synced to Maven Central automatically. -->
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>

      <plugin>
        <!-- Allow attaching Javadoc during releases -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.10.4</version>
        <configuration>
          <!-- Turn off Java 8 strict Javadoc checking -->
          <additionalparam>-Xdoclint:none</additionalparam>
          <tags>
            <tag>
              <name>notnull</name>
              <placement>a</placement>
              <head>Not null</head>
            </tag>
            <tag>
              <name>default</name>
              <placement>a</placement>
              <head>Default:</head>
            </tag>
          </tags>
        </configuration>
        <executions>
          <!-- Compress Javadoc into JAR and include that JAR when deploying. -->
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <!-- Include zipped source code in releases -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>1.5</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <!-- We sign in the verify phase, which means it will happen for install and deploy but not package. -->
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <repositories>
    <!-- Hack to force maven to check central first. Maven central is inherited from the superpom,
         but ends up at the end of the list. Though most of the time the artifact is in central,
         Maven tries to download from every other repository and fails before checking central.
         Do not change the id from central2 to central, otherwise the entry will be ignored. -->
    <repository>
      <id>central2</id>
      <name>check central first to avoid a lot of not found warnings</name>
      <url>https://repo1.maven.org/maven2</url>
    </repository>
    <repository>
      <id>conveyal</id>
      <name>conveyal</name>
      <url>https://maven.conveyal.com</url>
    </repository>
    <repository>
      <id>osgeo</id>
      <name>Open Source Geospatial Foundation Repository</name>
      <url>http://download.osgeo.org/webdav/geotools/</url>
    </repository>
    <repository>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <id>boundless</id>
      <name>Boundless Maven Repository</name>
      <url>https://repo.boundlessgeo.com/main</url>
    </repository>
    <!-- Needed  for graphql-java-->
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>bintray-andimarek-graphql-java</id>
      <name>bintray</name>
      <url>https://dl.bintray.com/andimarek/graphql-java</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.12</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <version>2.6.1</version>
    </dependency>
    <dependency>
      <groupId>com.vividsolutions</groupId>
      <artifactId>jts</artifactId>
      <version>1.13</version>
    </dependency>
    <dependency>
      <groupId>de.grundid.opendatalab</groupId>
      <artifactId>geojson-jackson</artifactId>
      <version>1.5</version>
    </dependency>
    <dependency>
      <groupId>net.sf.trove4j</groupId>
      <artifactId>trove4j</artifactId>
      <version>3.0.3</version>
    </dependency>
    <dependency>
      <groupId>net.sourceforge.javacsv</groupId>
      <artifactId>javacsv</artifactId>
      <version>2.0</version>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-opengis</artifactId>
      <version>${geotools.version}</version>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-api</artifactId>
      <version>${geotools.version}</version>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-shapefile</artifactId>
      <version>${geotools.version}</version>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-epsg-hsql</artifactId>
      <version>${geotools.version}</version>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-referencing</artifactId>
      <version>${geotools.version}</version>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-coverage</artifactId>
      <version>${geotools.version}</version>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-geojson</artifactId>
      <version>${geotools.version}</version>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-geotiff</artifactId>
      <version>${geotools.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-math3</artifactId>
      <version>3.0</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>18.0</version>
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
      <version>2.6.1</version>
    </dependency>
    <dependency>
      <groupId>com.conveyal</groupId>
      <artifactId>gtfs-lib</artifactId>
      <version>1.3.0</version>
    </dependency>
    <dependency>
      <groupId>com.conveyal</groupId>
      <artifactId>osm-lib</artifactId>
      <version>1.1.1</version>
    </dependency>
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-java-sdk-s3</artifactId>
      <version>1.11.18</version>
    </dependency>
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-java-sdk-ec2</artifactId>
      <version>1.11.18</version>
    </dependency>
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-lambda-java-core</artifactId>
      <version>1.1.0</version>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.1.3</version>
    </dependency>
    <dependency>
      <groupId>de.ruedigermoeller</groupId>
      <artifactId>fst</artifactId>
      <version>2.34</version>
    </dependency>
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-java-sdk-sqs</artifactId>
      <version>1.11.18</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.graphql-java</groupId>
      <artifactId>graphql-java</artifactId>
      <version>2016-02-19T11-51-00</version>
    </dependency>
    <dependency>
      <groupId>com.sparkjava</groupId>
      <artifactId>spark-core</artifactId>
      <version>2.3</version>
   </dependency>
   <dependency>
      <groupId>com.conveyal</groupId>
      <artifactId>jackson2-geojson</artifactId>
      <version>0.8</version>
    </dependency>
    <dependency>
      <groupId>org.mapdb</groupId>
      <artifactId>elsa</artifactId>
      <version>3.0.0-M5</version>
    </dependency>
    <dependency>
      <groupId>com.axiomalaska</groupId>
      <artifactId>polyline-encoder</artifactId>
      <version>0.1</version>
    </dependency>
  </dependencies>
</project>
