<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">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.janusgraph</groupId>
        <artifactId>janusgraph</artifactId>
        <version>0.5.2</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <artifactId>janusgraph-es</artifactId>
    <name>JanusGraph-ElasticSearch: Distributed Indexing Support</name>
    <url>https://janusgraph.org</url>
    <properties>
        <top.level.basedir>${basedir}/..</top.level.basedir>
        <elasticsearch60.docker.version>6.0.1</elasticsearch60.docker.version>
        <elasticsearch6.docker.version>6.6.0</elasticsearch6.docker.version>
        <elasticsearch7.docker.version>7.6.2</elasticsearch7.docker.version>
        <elasticsearch.docker.version>${elasticsearch7.docker.version}</elasticsearch.docker.version>
        <skip.es.test>${skipTests}</skip.es.test>
        <elasticsearch.docker.image>docker.elastic.co/elasticsearch/elasticsearch</elasticsearch.docker.image>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.janusgraph</groupId>
            <artifactId>janusgraph-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.janusgraph</groupId>
            <artifactId>janusgraph-backend-testutils</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.janusgraph</groupId>
            <artifactId>janusgraph-inmemory</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.janusgraph</groupId>
            <artifactId>janusgraph-berkeleyje</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.janusgraph</groupId>
            <artifactId>janusgraph-berkeleyje</artifactId>
            <version>${project.version}</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.janusgraph</groupId>
            <artifactId>janusgraph-cql</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.janusgraph</groupId>
            <artifactId>janusgraph-cql</artifactId>
            <version>${project.version}</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-client</artifactId>
        </dependency>

        <!-- Logging backends.
             Enforce a classpath ordering constraint to ensure log4j is used for logging.
             See comment in janusgraph-cassandra POM for more information. -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>
        <!-- End logging backends. -->

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-inline</artifactId>
			<scope>test</scope>
		</dependency>
        <!-- JNA is needed by Cassandra, but janusgraph-cassandra only defines it as an optional dependency. -->
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna</artifactId>
            <version>${jna.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>cassandra</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>elasticsearch</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
    		<groupId>com.googlecode.json-simple</groupId>
		    <artifactId>json-simple</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
    	</dependency>

    </dependencies>
    <build>
        <resources>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <testResources>
            <testResource>
                <directory>${basedir}/src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>

        <plugins>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>pack-test-jar</id>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>

                <executions>
                    <execution>
                        <id>default-test</id>
                        <configuration>
                            <skipTests>${skip.es.test}</skipTests>
                            <systemPropertyVariables>
                                <elasticsearch.docker.image>${elasticsearch.docker.image}</elasticsearch.docker.image>
                                <elasticsearch.docker.version>${elasticsearch.docker.version}</elasticsearch.docker.version>
                            </systemPropertyVariables>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>elasticsearch60</id>
            <properties>
                <elasticsearch.docker.version>${elasticsearch60.docker.version}</elasticsearch.docker.version>
            </properties>
        </profile>
        <profile>
            <id>elasticsearch6</id>
            <properties>
                <elasticsearch.docker.version>${elasticsearch6.docker.version}</elasticsearch.docker.version>
            </properties>
        </profile>
        <profile>
            <id>elasticsearch7</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <elasticsearch.docker.version>${elasticsearch7.docker.version}</elasticsearch.docker.version>
            </properties>
        </profile>

        <!-- Redeclare gpg-plugin at the bottom to ensure it runs after all the other packaging goals -->
        <profile>
            <id>janusgraph-release</id>

            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
