<?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>
    <artifactId>rest-api</artifactId>
    <groupId>uk.gov.gchq.gaffer</groupId>
    <version>1.14.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>spring-rest</artifactId>

  <properties>
    <spring.boot.version>1.3.2.RELEASE</spring.boot.version>
    <swagger.version>2.6.0</swagger.version>
    <store.type>map</store.type>
  </properties>

  <dependencies>
    <!-- Gaffer dependencies -->
    <dependency>
      <groupId>uk.gov.gchq.gaffer</groupId>
      <artifactId>common-rest</artifactId>
      <version>${project.parent.version}</version>
    </dependency>
    <dependency>
      <groupId>uk.gov.gchq.gaffer</groupId>
      <artifactId>${store.type}-store</artifactId>
      <version>${project.parent.version}</version>
    </dependency>

    <!-- external dependencies -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      <exclusions>
        <exclusion>
          <groupId>ch.qos.logback</groupId>
          <artifactId>logback-classic</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>log4j-over-slf4j</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.springfox</groupId>
      <artifactId>springfox-swagger2</artifactId>
      <version>${swagger.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.springfox</groupId>
      <artifactId>springfox-swagger-ui</artifactId>
      <version>${swagger.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId> <!-- required for version of Swagger -->
      <artifactId>guava</artifactId>
      <version>18.0</version>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring.boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
          <layout>ZIP</layout>
          <executable>true</executable>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>repackage</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!--
      Older version of Failsafe is being used as the Integration tests are written in junit 4 since it is
      dependent on an old version of Spring boot
       -->
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.18.1</version>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>demo</id>
      <dependencies>
        <dependency>
          <groupId>uk.gov.gchq.gaffer</groupId>
          <artifactId>${store.type}-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>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <version>${spring.boot.version}</version>
            <configuration>
              <jvmArguments>
                -Dgaffer.storeProperties=${project.build.outputDirectory}/${store.type}/store.properties
                -Dgaffer.graph.config=${project.build.outputDirectory}/graphConfig.json
                -Dgaffer.schemas=${project.build.outputDirectory}/schemas
              </jvmArguments>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>