<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>gtfs-lib</name>
  <description>A library to load and index GTFS feeds of arbitrary size using disk-backed storage</description>
  <url>https://github.com/conveyal/gtfs-lib</url>

  <groupId>com.conveyal</groupId>
  <artifactId>gtfs-lib</artifactId>
  <version>4.2.2</version>
  <packaging>jar</packaging>

  <licenses>
    <license>
      <name>BSD Two Clause</name>
      <url>https://opensource.org/licenses/BSD-2-Clause</url>
    </license>
  </licenses>

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

  <!-- Define where the source code for this project lives -->
  <scm>
    <connection>scm:git:https://github.com/conveyal/gtfs-lib.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/conveyal/gtfs-lib.git</developerConnection>
    <url>https://github.com/conveyal/gtfs-lib</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>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.2</version>
        <configuration>
          <!-- Target Java versions -->
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </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.3</version>
        <configuration>
          <!-- Turn off Java 8 strict Javadoc checking -->
          <additionalparam>-Xdoclint:none</additionalparam>
        </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>

      <plugin>
        <!-- Attach a version of the JAR that includes all dependencies -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.2</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <!-- The shaded JAR will not be the main artifact for the project, it will be attached
                for deployment in the way source and docs are. -->
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>shaded</shadedClassifierName>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                  <manifestEntries>
                    <Main-Class>com.conveyal.gtfs.GTFSMain</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>
      <!-- This plugin calculates code coverage and generates a report during the test phase in maven -->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.7.9</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <repositories>
    <repository>
      <id>conveyal</id>
      <name>Conveyal Maven Repository</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>
    <!--  used for importing java projects from github -->
    <repository>
      <id>jitpack.io</id>
      <url>https://jitpack.io</url>
    </repository>
  </repositories>

  <dependencies>
    <!-- CSV parser -->
    <dependency>
      <groupId>net.sourceforge.javacsv</groupId>
      <artifactId>javacsv</artifactId>
      <version>2.0</version>
    </dependency>
    <!-- JUnit is a Java testing framework. -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <!-- Parses command line arguments to main methods. -->
    <dependency>
    	<groupId>com.beust</groupId>
    	<artifactId>jcommander</artifactId>
    	<version>1.30</version>
    </dependency>
    <!-- This package allows you to run tests on code that call System.exit() -->
    <dependency>
      <groupId>com.github.stefanbirkner</groupId>
      <artifactId>system-rules</artifactId>
      <version>1.16.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
    	<groupId>com.google.guava</groupId>
    	<artifactId>guava</artifactId>
    	<version>18.0</version>
    </dependency>
    <dependency>
    	<groupId>com.vividsolutions</groupId>
    	<artifactId>jts</artifactId>
    	<version>1.13</version>
    </dependency>
    <!-- Hamcrest is an assertion library that prints pretty messages when assertions fail -->
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>java-hamcrest</artifactId>
      <version>2.0.0.0</version>
    </dependency>
    <!-- Snapshotting library for testing -->
    <dependency>
      <groupId>com.github.Zenika</groupId>
      <artifactId>java-snapshot-matcher</artifactId>
      <version>7e6ed4049eb637334e56f84bdd23ea74da05f141</version>
    </dependency>
    <!-- Disk-backed storage that looks like a Java map. -->
    <dependency>
    	<groupId>org.mapdb</groupId>
    	<artifactId>mapdb</artifactId>
    	<version>1.0.8</version>
    </dependency>
    <!-- Our logging API, no implementation specified as gtfs-lib is a library. -->
    <dependency>
    	<groupId>org.slf4j</groupId>
    	<artifactId>slf4j-api</artifactId>
    	<version>1.7.10</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.7.25</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
    	<groupId>commons-io</groupId>
    	<artifactId>commons-io</artifactId>
    	<version>2.4</version>
    </dependency>
    <!-- Commons DBUtils is a collection of utility methods that help avoid boilerplate when working with SQL. -->
    <dependency>
      <groupId>commons-dbutils</groupId>
      <artifactId>commons-dbutils</artifactId>
      <version>1.6</version>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-api</artifactId>
      <version>${geotools.version}</version>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-epsg-hsql</artifactId>
      <version>11-beta</version>
    </dependency>
    <!-- For uploading / downloading things from Amazon S3.
         We should really eliminate this functionality, it's out of scope for this gtfs-lib library. -->
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-java-sdk-s3</artifactId>
      <version>1.11.18</version>
    </dependency>
    <!-- Very efficient collections of primitive data types for Java. -->
    <dependency>
      <groupId>net.sf.trove4j</groupId>
      <artifactId>trove4j</artifactId>
      <version>3.0.3</version>
    </dependency>
    <!-- Another command line parameter parser - should we really have two of these in our dependencies? -->
    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
      <version>1.4</version>
    </dependency>
    <!-- We should really find a way to do this without forking Jackson -->
    <dependency>
      <groupId>com.conveyal</groupId>
      <artifactId>jackson2-geojson</artifactId>
      <version>0.8</version>
    </dependency>
    <!-- JDBC support for Postgres databases. More modules would need to be added to access H2, SQLite etc. -->
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>42.0.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-math3</artifactId>
      <version>3.0</version>
    </dependency>
    <!-- Database connection pooling, implements interfaces in JDBC -->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-dbcp2</artifactId>
      <version>2.1.1</version>
    </dependency>
    <!-- GraphQL for Java, without HTTP layer, just query and response handling. -->
    <dependency>
      <groupId>com.graphql-java</groupId>
      <artifactId>graphql-java</artifactId>
      <version>11.0</version>
    </dependency>
  </dependencies>
</project>
