<?xml version="1.0" encoding="UTF-8"?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.

-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.apache.hbase.connectors</groupId>
    <artifactId>spark</artifactId>
    <version>1.0.1</version>
    <relativePath>../</relativePath>
  </parent>
  <groupId>org.apache.hbase.connectors.spark</groupId>
  <artifactId>hbase-spark</artifactId>
  <version>1.0.1</version>
  <name>Apache HBase - Spark Connector</name>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hbase.thirdparty</groupId>
      <artifactId>hbase-shaded-miscellaneous</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.1.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>
      <version>${scala.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-core_${scala.binary.version}</artifactId>
      <version>${spark.version}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>scala-library</artifactId>
          <groupId>org.scala-lang</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scalap</artifactId>
          <groupId>org.scala-lang</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jsr305</artifactId>
          <groupId>com.google.code.findbugs</groupId>
        </exclusion>
        <exclusion>
          <artifactId>snappy-java</artifactId>
          <groupId>org.xerial.snappy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>xercesImpl</artifactId>
          <groupId>xerces</groupId>
        </exclusion>
        <exclusion>
          <artifactId>hadoop-client-api</artifactId>
          <groupId>org.apache.hadoop</groupId>
        </exclusion>
        <exclusion>
          <artifactId>hadoop-client-runtime</artifactId>
          <groupId>org.apache.hadoop</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-sql_${scala.binary.version}</artifactId>
      <version>${spark.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-streaming_${scala.binary.version}</artifactId>
      <version>${spark.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-streaming_${scala.binary.version}</artifactId>
      <version>${spark.version}</version>
      <type>test-jar</type>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.scalatest</groupId>
      <artifactId>scalatest_${scala.binary.version}</artifactId>
      <version>3.0.5</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>scala-library</artifactId>
          <groupId>org.scala-lang</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.hbase</groupId>
      <artifactId>hbase-shaded-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hbase.connectors.spark</groupId>
      <artifactId>hbase-spark-protocol-shaded</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.yetus</groupId>
      <artifactId>audience-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hbase</groupId>
      <artifactId>hbase-shaded-testing-util</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hbase</groupId>
      <artifactId>hbase-annotations</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.hbase</groupId>
      <artifactId>hbase-shaded-mapreduce</artifactId>
      <version>${hbase.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.avro</groupId>
      <artifactId>avro</artifactId>
    </dependency>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-reflect</artifactId>
      <version>${scala.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-unsafe_${scala.binary.version}</artifactId>
      <version>${spark.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-catalyst_${scala.binary.version}</artifactId>
      <version>${spark.version}</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>validate</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/main/scala</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-test-source</id>
            <phase>validate</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/test/scala</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>banned-scala</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <skip>true</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>net.revelc.code</groupId>
        <artifactId>warbucks-maven-plugin</artifactId>
        <configuration>
          <ignoreRuleFailures>true</ignoreRuleFailures>
          <rules>
            <rule>
              <classPattern>(?!.*(.generated.|.tmpl.|\$|org.apache.hadoop.hbase.spark.hbase.package)).*</classPattern>
              <includeTestClasses>false</includeTestClasses>
              <includePublicClasses>true</includePublicClasses>
              <includePackagePrivateClasses>false</includePackagePrivateClasses>
              <includeProtectedClasses>false</includeProtectedClasses>
              <includePrivateClasses>false</includePrivateClasses>
              <classAnnotationPattern>org[.]apache[.]yetus[.]audience[.]InterfaceAudience.*</classAnnotationPattern>
            </rule>
          </rules>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>skipSparkTests</id>
      <activation>
        <property>
          <name>skipSparkTests</name>
        </property>
      </activation>
      <properties>
        <skipTests>true</skipTests>
        <surefire.skipFirstPart>true</surefire.skipFirstPart>
        <surefire.skipSecondPart>true</surefire.skipSecondPart>
      </properties>
    </profile>
    <profile>
      <id>hadoop-2.0</id>
      <activation>
        <property>
          <name>hadoop.profile</name>
          <value>2.0</value>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.apache.hadoop</groupId>
          <artifactId>hadoop-client</artifactId>
          <version>${hadoop-two.version}</version>
        </dependency>
        <dependency>
          <groupId>org.apache.hadoop</groupId>
          <artifactId>hadoop-common</artifactId>
          <version>${hadoop-two.version}</version>
          <exclusions>
            <exclusion>
              <artifactId>jsr305</artifactId>
              <groupId>com.google.code.findbugs</groupId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>org.apache.hadoop</groupId>
          <artifactId>hadoop-common</artifactId>
          <version>${hadoop-two.version}</version>
          <type>test-jar</type>
          <scope>test</scope>
          <exclusions>
            <exclusion>
              <artifactId>jsr305</artifactId>
              <groupId>com.google.code.findbugs</groupId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>org.apache.hadoop</groupId>
          <artifactId>hadoop-hdfs</artifactId>
          <version>${hadoop-two.version}</version>
          <type>test-jar</type>
          <scope>test</scope>
          <exclusions>
            <exclusion>
              <artifactId>jsr305</artifactId>
              <groupId>com.google.code.findbugs</groupId>
            </exclusion>
            <exclusion>
              <artifactId>xercesImpl</artifactId>
              <groupId>xerces</groupId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>org.apache.hadoop</groupId>
          <artifactId>hadoop-minikdc</artifactId>
          <version>${hadoop-two.version}</version>
          <scope>test</scope>
          <exclusions>
            <exclusion>
              <artifactId>apacheds-jdbm1</artifactId>
              <groupId>org.apache.directory.jdbm</groupId>
            </exclusion>
          </exclusions>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>hadoop-3.0</id>
      <activation>
        <property>
          <name>!hadoop.profile</name>
        </property>
      </activation>
      <properties>
        <os.detected.name>osx</os.detected.name>
        <os.detected.classifier>osx-x86_64</os.detected.classifier>
        <os.detected.arch>x86_64</os.detected.arch>
        <hadoop.version>${hadoop-three.version}</hadoop.version>
      </properties>
      <dependencies>
        <dependency>
          <groupId>org.apache.hadoop</groupId>
          <artifactId>hadoop-client</artifactId>
          <version>3.2.4</version>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.hadoop</groupId>
          <artifactId>hadoop-common</artifactId>
          <version>3.2.4</version>
          <scope>compile</scope>
          <exclusions>
            <exclusion>
              <artifactId>jsr305</artifactId>
              <groupId>com.google.code.findbugs</groupId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>org.apache.hadoop</groupId>
          <artifactId>hadoop-common</artifactId>
          <version>3.2.4</version>
          <type>test-jar</type>
          <scope>test</scope>
          <exclusions>
            <exclusion>
              <artifactId>jsr305</artifactId>
              <groupId>com.google.code.findbugs</groupId>
            </exclusion>
            <exclusion>
              <artifactId>log4j</artifactId>
              <groupId>log4j</groupId>
            </exclusion>
            <exclusion>
              <artifactId>slf4j-log4j12</artifactId>
              <groupId>org.slf4j</groupId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>org.apache.hadoop</groupId>
          <artifactId>hadoop-hdfs</artifactId>
          <version>3.2.4</version>
          <type>test-jar</type>
          <scope>test</scope>
          <exclusions>
            <exclusion>
              <artifactId>jsr305</artifactId>
              <groupId>com.google.code.findbugs</groupId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>org.apache.hadoop</groupId>
          <artifactId>hadoop-minikdc</artifactId>
          <version>3.2.4</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>build-scala-sources</id>
      <activation>
        <property>
          <name>scala.skip</name>
          <value>!true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.gmaven</groupId>
            <artifactId>gmaven-plugin</artifactId>
            <version>1.5</version>
            <executions>
              <execution>
                <phase>validate</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <source>pom.properties['target.jvm'] =
                    pom.properties['scala.version'].startsWith('2.10')? '': '-target:jvm-1.8';</source>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <version>4.3.0</version>
            <executions>
              <execution>
                <id>scala-compile-first</id>
                <phase>process-resources</phase>
                <goals>
                  <goal>add-source</goal>
                  <goal>compile</goal>
                </goals>
                <configuration>
                  <charset>UTF-8</charset>
                  <scalaVersion>2.12.15</scalaVersion>
                  <args>
                    <arg>-feature</arg>
                    <arg>${target.jvm}</arg>
                  </args>
                  <source>1.8</source>
                  <target>1.8</target>
                </configuration>
              </execution>
              <execution>
                <id>scala-test-compile</id>
                <phase>process-test-resources</phase>
                <goals>
                  <goal>testCompile</goal>
                </goals>
                <configuration>
                  <charset>UTF-8</charset>
                  <scalaVersion>2.12.15</scalaVersion>
                  <args>
                    <arg>-feature</arg>
                    <arg>${target.jvm}</arg>
                  </args>
                  <source>1.8</source>
                  <target>1.8</target>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <charset>UTF-8</charset>
              <scalaVersion>2.12.15</scalaVersion>
              <args>
                <arg>-feature</arg>
                <arg>${target.jvm}</arg>
              </args>
              <source>1.8</source>
              <target>1.8</target>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest-maven-plugin</artifactId>
            <version>2.0.2</version>
            <executions>
              <execution>
                <id>test</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
                <configuration>
                  <argLine>-Xmx1536m -XX:ReservedCodeCacheSize=512m</argLine>
                  <parallel>false</parallel>
                  <reportsDirectory>/Users/taklwu/hbase-vote/hbase-connectors/hbase-connectors/spark/hbase-spark/target/surefire-reports</reportsDirectory>
                  <junitxml>.</junitxml>
                  <filereports>WDF TestSuite.txt</filereports>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <reportsDirectory>/Users/taklwu/hbase-vote/hbase-connectors/hbase-connectors/spark/hbase-spark/target/surefire-reports</reportsDirectory>
              <junitxml>.</junitxml>
              <filereports>WDF TestSuite.txt</filereports>
              <parallel>false</parallel>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <os.detected.name>osx</os.detected.name>
        <os.detected.classifier>osx-x86_64</os.detected.classifier>
        <os.detected.arch>x86_64</os.detected.arch>
      </properties>
    </profile>
    <profile>
      <id>coverage</id>
      <activation />
      <build>
        <plugins>
          <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>default-sbt-compile</id>
                <goals>
                  <goal>compile</goal>
                  <goal>testCompile</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <testSourceDir>src/test/scala</testSourceDir>
              <sourceDir>src/main/scala</sourceDir>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <skipMain>true</skipMain>
              <skip>true</skip>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.scoverage</groupId>
            <artifactId>scoverage-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>instrument</id>
                <goals>
                  <goal>pre-compile</goal>
                  <goal>post-compile</goal>
                </goals>
              </execution>
              <execution>
                <id>package</id>
                <goals>
                  <goal>package</goal>
                  <goal>report</goal>
                </goals>
              </execution>
              <execution>
                <id>scoverage-report</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>report-only</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <scalacPluginVersion>1.4.11</scalacPluginVersion>
              <highlighting>true</highlighting>
              <aggregate>true</aggregate>
              <failOnError>false</failOnError>
              <encoding>${project.build.sourceEncoding}</encoding>
              <outputDirectory>${scoverageReportDir}</outputDirectory>
              <xmlOutputDirectory>${scoverageReportDir}</xmlOutputDirectory>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <main.basedir>${project.parent.parent.basedir}</main.basedir>
        <sonar.sources>src/main/</sonar.sources>
      </properties>
      <reporting>
        <plugins>
          <plugin>
            <groupId>org.scoverage</groupId>
            <artifactId>scoverage-maven-plugin</artifactId>
            <reportSets>
              <reportSet>
                <reports>
                  <report>report-only</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
        </plugins>
      </reporting>
    </profile>
  </profiles>
</project>
