<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Grakn - A Distributed Semantic Database
  ~ Copyright (C) 2016  Grakn Labs Limited
  ~
  ~ Grakn is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or
  ~ (at your option) any later version.
  ~
  ~ Grakn is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with Grakn. If not, see <http://www.gnu.org/licenses/gpl.txt>.
  -->

<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>grakn-test-profiles</artifactId>
        <relativePath>../grakn-test-profiles</relativePath>
        <groupId>ai.grakn</groupId>
        <version>0.14.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>grakn-test</artifactId>
    <packaging>jar</packaging>

    <properties>
        <jenkins.docker-test.reportsDirectory>${project.basedir}/target/surefire-reports</jenkins.docker-test.reportsDirectory>
    </properties>

    <dependencies>
        <dependency>
            <groupId>ai.grakn</groupId>
            <artifactId>grakn-core</artifactId>
            <version>${project.version}</version>
        </dependency>        
        <dependency>
            <groupId>ai.grakn</groupId>
            <artifactId>grakn-graql</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>ai.grakn</groupId>
            <artifactId>grakn-client</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>ai.grakn</groupId>
            <artifactId>grakn-engine</artifactId>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>ai.grakn</groupId>
            <artifactId>grakn-graql-shell</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
        </dependency>
        <dependency>
            <groupId>com.jayway.restassured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>${rest-assured.version}</version>
        </dependency>
        <dependency>
            <groupId>net.lingala.zip4j</groupId>
            <artifactId>zip4j</artifactId>
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>${commons-collections.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-csv</artifactId>
            <version>${commons-csv.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.kstyrc</groupId>
            <artifactId>embedded-redis</artifactId>
            <version>${redis-test.version}</version>
        </dependency>

        <!-- migration -->
        <dependency>
            <groupId>ai.grakn</groupId>
            <artifactId>migration-sql</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>${h2-database.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ai.grakn</groupId>
            <artifactId>migration-csv</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ai.grakn</groupId>
            <artifactId>migration-owl</artifactId>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-annotations</artifactId>
                </exclusion>
            </exclusions>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ai.grakn</groupId>
            <artifactId>migration-json</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ai.grakn</groupId>
            <artifactId>migration-export</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ai.grakn</groupId>
            <artifactId>migration-base</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.owlapi</groupId>
            <artifactId>org.semanticweb.hermit</artifactId>
            <version>${hermit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.github.stefanbirkner</groupId>
            <artifactId>system-rules</artifactId>
            <version>${systen-rules.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.curator</groupId>
            <artifactId>curator-test</artifactId>
            <scope>test</scope>
            <version>${curator.version}</version>
        </dependency>
        <dependency>
            <groupId>info.batey.kafka</groupId>
            <artifactId>kafka-unit</artifactId>
            <version>${kafka-unit.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-io</groupId>
                    <artifactId>commons-io</artifactId>
                </exclusion>
                <exclusion>
                    <!--Cannot be present with log4j-over-slf4j-->
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>ai.grakn</groupId>
            <artifactId>titan-factory</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
            <!--Excluded because we provide logback logger-->
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-nop</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.cassandraunit</groupId>
            <artifactId>cassandra-unit</artifactId>
            <version>${cassandra-unit.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.datastax.cassandra</groupId>
            <artifactId>cassandra-driver-core</artifactId>
            <version>3.1.2</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.5.0</version>
                <configuration>
                    <skip>${skip-docker-tests}</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>docker-image-with-src-compiled</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                            <executable>/usr/bin/docker</executable>
                            <arguments>
                                <argument>build</argument>
                                <argument>-t</argument>
                                <argument>graknlabs/jenkins-with-src-compiled:latest</argument>
                                <argument>${project.basedir}/../</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>docker-test</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                            <executable>${project.basedir}/bin/run_test_in_docker.sh</executable>
                            <arguments>
                                <argument>${grakn.test-profile}</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
