<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mapr.db</groupId>
  <artifactId>maprdb</artifactId>
  <version>6.1.0-mapr</version>
  <parent>
    <groupId>com.mapr</groupId>
    <artifactId>mapr-release</artifactId>
    <version>6.1.0-mapr</version>
    <relativePath/>
  </parent>
  <name>MapR DB Client</name>
  <url>http://www.mapr.com/</url>
  <repositories>
    <repository>
      <id>mapr-releases</id>
      <url>http://repository.mapr.com/maven/</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>true</enabled>
      </releases>
    </repository>
  </repositories>
  <dependencies>
    <dependency>
      <groupId>org.ojai</groupId>
      <artifactId>ojai</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>com.mapr.hadoop</groupId>
      <artifactId>maprfs</artifactId>
      <exclusions>
        <exclusion>
          <artifactId>slf4j-log4j12</artifactId>
          <groupId>org.slf4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>httpclient</artifactId>
          <groupId>org.apache.httpcomponents</groupId>
        </exclusion>
        <exclusion>
          <artifactId>httpcore</artifactId>
          <groupId>org.apache.httpcomponents</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-common</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>com.tdunning</groupId>
      <artifactId>json</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>com.mapr</groupId>
      <artifactId>mapr-java-utils</artifactId>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.mapr.hadoop</groupId>
      <artifactId>maprfs</artifactId>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <artifactId>slf4j-log4j12</artifactId>
      <groupId>org.slf4j</groupId>
    </dependency>
    <dependency>
      <artifactId>jol-core</artifactId>
      <groupId>org.openjdk.jol</groupId>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/core-site.xml</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <excludePackageNames>com.mapr.streams:com.mapr.db.impl:com.mapr.db.ojai:com.mapr.db.rowcol:com.mapr.db.tools:com.mapr.db.util</excludePackageNames>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>object-allocation-tests</id>
      <activation>
        <property>
          <name>!no-object-allocation-tests</name>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>com.google.code.java-allocation-instrumenter</groupId>
          <artifactId>java-allocation-instrumenter</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>copy-test-dependencies</id>
                <phase>process-test-resources</phase>
                <goals>
                  <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}/agent</outputDirectory>
                  <includeArtifactIds>java-allocation-instrumenter</includeArtifactIds>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>object-allocation-tests</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
                <configuration>
                  <failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
                  <groups>com.mapr.tests.annotations.IsolatedTest</groups>
                  <includes>
                    <include>**/ObjectAllocationTestOnDBOperations.java</include>
                  </includes>
                  <systemProperties>
                    <MAPR_TESTS_LOG_FILE>allocation_report.log</MAPR_TESTS_LOG_FILE>
                    <MAPR_TESTS_LOG_PATTERN>%m%n</MAPR_TESTS_LOG_PATTERN>
                  </systemProperties>
                  <argLine>-javaagent:${project.build.directory}/agent/java-allocation-instrumenter-3.0.jar ${surefire.argline}</argLine>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>client-impersonation-tests</id>
      <activation>
        <property>
          <name>!no-client-impersonation-tests</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>client-impersonation-tests</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
                <configuration>
                  <failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
                  <groups>com.mapr.tests.annotations.IsolatedTest</groups>
                  <includes>
                    <include>**/ImpersonationTestOnDBOperations.java</include>
                  </includes>
                  <environmentVariables>
                    <MAPR_IMPERSONATION_ENABLED>true</MAPR_IMPERSONATION_ENABLED>
                  </environmentVariables>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
