<?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">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.hbase</groupId>
    <artifactId>hbase</artifactId>
    <version>2.4.14-h0.cbu.mrs.330.r22</version>
    <relativePath>..</relativePath>
  </parent>

  <artifactId>hbase-hindex-global</artifactId>
  <packaging>pom</packaging>
  <name>Huawei HBase - Global Secondary Index</name>
  <description>Secondary index related funcationality for HBase</description>

  <modules>
    <module>protocol</module>
    <module>index</module>
    <module>client</module>
    <module>common</module>
    <module>protocol-shaded</module>
  </modules>

  <properties>
    <external.protoc.groupid>com.google.protobuf</external.protoc.groupid>
    <external.protoc.version>${external.protobuf.version}</external.protoc.version>
    <dep.os.arch/>
    <active.devtest>false</active.devtest>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-global-index-protocol</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-global-index-protocol-shaded</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-global-index-common</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-global-index-client</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-global-index</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-procedure</artifactId>
        <version>${project.version}</version>
        <type>test-jar</type>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <finalName>${artifactId}-${version}${dep.os.arch}</finalName>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <groupId>org.xolstice.maven.plugins</groupId>
          <artifactId>protobuf-maven-plugin</artifactId>
          <version>${protobuf.plugin.version}</version>
          <configuration>
            <protocArtifact>${external.protoc.groupid}:protoc:${external.protoc.version}:exe:${os.detected.classifier}</protocArtifact>
            <protoSourceRoot>${basedir}/src/main/protobuf/</protoSourceRoot>
            <clearOutputDirectory>false</clearOutputDirectory>
            <checkStaleness>true</checkStaleness>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <extensions>
      <extension>
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
        <version>${os.maven.version}</version>
      </extension>
    </extensions>
  </build>

  <profiles>
    <profile>
      <id>aarch64</id>
      <activation>
        <os>
          <family>linux</family>
          <arch>aarch64</arch>
        </os>
      </activation>
      <properties>
        <external.protoc.groupid>org.openlabtesting.protobuf</external.protoc.groupid>
        <external.protoc.version>2.5.0.2</external.protoc.version>
      </properties>
    </profile>
    <profile>
      <id>test</id>
      <dependencies>
        <dependency>
          <groupId>org.jacoco</groupId>
          <artifactId>org.jacoco.agent</artifactId>
          <version>0.7.9</version>
          <classifier>runtime</classifier>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>com.huawei.devtest</groupId>
            <artifactId>devtestcov-maven-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
              <activeDevtest>${active.devtest}</activeDevtest>
              <reportService>SiteManagement</reportService>
              <reportVersion>2.1.0</reportVersion>
              <autoOpenReport>true</autoOpenReport>
              <excludeStats>
                <item>org.apache.hadoop.hbase.hindex.global.protobuf.*</item>
                <item>org.apache.hadoop.hbase.hindex.global.shaded.protobuf.*</item>
              </excludeStats>
            </configuration>
            <executions>
              <execution>
                <id>insert</id>
                <goals>
                  <goal>dev_insert</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
