<?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>dashbuilder-backend</artifactId>
    <groupId>org.dashbuilder</groupId>
    <version>0.4.0.Final</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>dashbuilder-dataset-elasticsearch</artifactId>
  <name>Dashbuilder Dataset ElasticSearch Provider</name>

  <build>
    
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration combine.self="override">
          <!-- NOTE: Java 1.7.0_40 suffers from critical bug that produces the Elastic Search server fail on startup.
                     Using this JVM argument you can skip the error and force running the ELS instance. -->
          <argLine>-XX:-UseSuperWord</argLine>

          <!-- Run the integration Test Suite. Skip the local for development.-->
          <includes>
            <include>**/*TestSuite.java</include>
          </includes>
          <excludes>
            <exclude>**/LocalTestSuite.java</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
    
  </build>

  <dependencies>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.dashbuilder</groupId>
      <artifactId>dashbuilder-dataset-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.dashbuilder</groupId>
      <artifactId>dashbuilder-dataset-core</artifactId>
    </dependency>

    <dependency>
      <groupId>org.dashbuilder</groupId>
      <artifactId>dashbuilder-dataset-shared</artifactId>
    </dependency>
    
    <dependency>
      <groupId>com.googlecode.json-simple</groupId>
      <artifactId>json-simple</artifactId>
      <type>jar</type>
    </dependency>

    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
    </dependency>

    <!-- Jest ES client. -->
    <dependency>
      <groupId>io.searchbox</groupId>
      <artifactId>jest</artifactId>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- Replacement for the commons-logging removed from io.searchbox:jest -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
    </dependency>

    <dependency>
      <groupId>io.searchbox</groupId>
      <artifactId>jest-common</artifactId>
    </dependency>

    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
    </dependency>

    <!-- Testing scope -->
    
    <dependency>
      <groupId>org.elasticsearch</groupId>
      <artifactId>elasticsearch</artifactId>
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>org.apache.lucene</groupId>
      <artifactId>lucene-core</artifactId>
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>org.apache.lucene</groupId>
      <artifactId>lucene-queryparser</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <type>jar</type>
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>org.dashbuilder</groupId>
      <artifactId>dashbuilder-dataset-core</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.dashbuilder</groupId>
      <artifactId>dashbuilder-dataset-api</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.easytesting</groupId>
      <artifactId>fest-assert-core</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <profiles>

    <!-- Test - Development profile. ELS instance running and populated with default data on localhost at port tcp 9200.
        @See org.dashbuilder.dataprovider.backend.elasticsearch.suite.LocalTestSuite
        mvn clean test -Ddev
    -->
    <profile>
      <id>test-development</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <property>
          <name>dev</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration combine.self="override">
              <!-- NOTE: Java 1.7.0_40 suffers from critical bug that produces the Elastic Search server fail on startup.
                         Using this JVM argument you can skip the error and force running the ELS instance. -->
              <argLine>-XX:-UseSuperWord</argLine>

              <!-- Run the integration Test Suite. Skip the local for development.-->
              <includes>
                <include>**/LocalTestSuite.java</include>
              </includes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>
  
</project>
