<?xml version="1.0" encoding="ISO-8859-1"?>
<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>

  <parent>
    <groupId>org.geoserver</groupId>
    <artifactId>community</artifactId>
    <version>2.13-SNAPSHOT</version>
  </parent>

  <groupId>org.geoserver.community</groupId>
  <artifactId>gs-geogig</artifactId>
  <packaging>jar</packaging>
  <name>GeoGig GeoServer integration</name>

  <properties>
    <geogig.version>1.2-SNAPSHOT</geogig.version>
    <jline.version>2.12</jline.version>
    <mockito.version>1.8.5</mockito.version>
    <logback.version>1.1.2</logback.version>
    <cucumber-java.version>1.2.4</cucumber-java.version>
    <hikaricp.version>2.4.2</hikaricp.version>
  </properties>

  <repositories>
    <repository>
      <id>repo.locationtech.org</id>
      <name>GeoGig Repository</name>
      <url>https://repo.locationtech.org/content/repositories/geogig/</url>
    </repository>
    <repository>
      <id>oracle</id>
      <name>Oracles Maven Repository</name>
      <url>http://download.oracle.com/maven/</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-core</artifactId>
      <version>${logback.version}</version>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>${logback.version}</version>
    </dependency>
    <dependency>
      <groupId>org.locationtech.geogig</groupId>
      <artifactId>geogig-geotools</artifactId>
      <version>${geogig.version}</version>
    </dependency>
    <dependency>
      <groupId>org.locationtech.geogig</groupId>
      <artifactId>geogig-datastore</artifactId>
      <version>${geogig.version}</version>
    </dependency>
    <dependency>
      <groupId>org.locationtech.geogig</groupId>
      <artifactId>geogig-web-api</artifactId>
      <version>${geogig.version}</version>
    </dependency>
    <dependency>
      <groupId>com.zaxxer</groupId>
      <artifactId>HikariCP</artifactId>
      <version>${hikaricp.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
    </dependency>
    <!--
      The following are geotools dependencies that geogig uses but we declare explicitly
      here with a provided scope, since we excluded all geotools transitive dependencies
      in the geogig entries above in order to avoid having duplicates when geogig is tied
      to a different geotools version than this project.
     -->
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-geojson</artifactId>
      <version>${gt.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.geotools.jdbc</groupId>
      <artifactId>gt-jdbc-postgis</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.geotools.jdbc</groupId>
      <artifactId>gt-jdbc-sqlserver</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.geotools.jdbc</groupId>
      <artifactId>gt-jdbc-oracle</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-referencing</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-main</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-cql</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-epsg-hsql</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-geopkg</artifactId>
      <version>${gt.version}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>org.geotools</groupId>
          <artifactId>gt-coverage</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.geoserver</groupId>
      <artifactId>gs-main</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.geoserver.web</groupId>
      <artifactId>gs-web-core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.geoserver</groupId>
      <artifactId>gs-ows</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.geoserver</groupId>
      <artifactId>gs-rest</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.geoserver</groupId>
      <artifactId>gs-wfs</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.geoserver</groupId>
      <artifactId>gs-gwc</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.geoserver</groupId>
      <artifactId>gs-restconfig</artifactId>
      <version>${gs.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>info.cukes</groupId>
      <artifactId>cucumber-java</artifactId>
      <version>${cucumber-java.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>info.cukes</groupId>
      <artifactId>cucumber-junit</artifactId>
      <version>${cucumber-java.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>info.cukes</groupId>
      <artifactId>cucumber-guice</artifactId>
      <version>${cucumber-java.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.locationtech.geogig</groupId>
      <artifactId>geogig-core</artifactId>
      <version>${geogig.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.locationtech.geogig</groupId>
      <artifactId>geogig-geotools</artifactId>
      <version>${geogig.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.locationtech.geogig</groupId>
      <artifactId>geogig-web-api</artifactId>
      <version>${geogig.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.locationtech.geogig</groupId>
      <artifactId>geogig-web-api-functional-tests</artifactId>
      <version>${geogig.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.locationtech.geogig</groupId>
      <artifactId>geogig-api</artifactId>
      <version>${geogig.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.geoserver.web</groupId>
      <artifactId>gs-web-core</artifactId>
      <version>${gs.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.locationtech.geogig</groupId>
      <artifactId>geogig-cli</artifactId>
      <version>${geogig.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.geoserver</groupId>
      <artifactId>gs-main</artifactId>
      <version>${gs.version}</version>
      <type>test-jar</type>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.geoserver</groupId>
      <artifactId>gs-wfs</artifactId>
      <version>${gs.version}</version>
      <type>test-jar</type>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.geoserver</groupId>
      <artifactId>gs-restconfig</artifactId>
      <version>${gs.version}</version>
      <type>test-jar</type>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.xmlunit</groupId>
      <artifactId>xmlunit-core</artifactId>
      <version>2.1.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.xmlunit</groupId>
      <artifactId>xmlunit-matchers</artifactId>
      <version>2.1.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.mockrunner</groupId>
      <artifactId>mockrunner</artifactId>
      <version>0.3.6</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.5.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpmime</artifactId>
      <version>4.5.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>jacoco</id>
      <build>
        <plugins>
          <plugin>
            <!--
             Overriding the root pom's surefire plugin configuration is
             necessary in order to set argLine to ${argLine} as the value
             is passed by the jacoco prepare-agent goal
            -->
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <argLine>${argLine}</argLine>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.7.7.201606060606</version>
            <configuration>
              <excludes>
                <exclude>**/*Exception.class</exclude>
              </excludes>
            </configuration>
            <executions>
              <execution>
                <id>pre-unit-test</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>post-unit-test</id>
                <phase>test</phase>
                <goals>
                  <goal>report</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <!-- Profile to build in RocksDB backend module. This profile is active by default. -->
      <id>geogig-rocksdb</id>
      <activation>
        <property>
          <name>disableRocksDBBackend</name>
          <value>!true</value>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.locationtech.geogig</groupId>
          <artifactId>geogig-rocksdb</artifactId>
          <version>${geogig.version}</version>
          <scope>runtime</scope>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <!-- Profile to build in PostgreSQL backend module. This profile is active by default. -->
      <id>geogig-postgresql</id>
      <activation>
        <property>
          <name>disablePostgreSQLBackend</name>
          <value>!true</value>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.locationtech.geogig</groupId>
          <artifactId>geogig-postgres</artifactId>
          <version>${geogig.version}</version>
          <scope>runtime</scope>
        </dependency>
      </dependencies>
    </profile>
  </profiles>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>process-resources</id>
            <phase>process-resources</phase>
            <configuration>
              <tasks>
	      <replace dir="${project.build.outputDirectory}/org/geogig/geoserver/config" encoding="UTF-8">
                  <include name="module_version.properties"/> 
                  <replacefilter token="@project.version@" value="${project.version}"/>
                  <replacefilter token="@build.revision@" value="${build.commit.id}"/>
                  <replacefilter token="@build.timestamp@" value="${build.timestamp}"/>
                </replace>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
