<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015 Google Inc. All Rights Reserved.

Licensed 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 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>

  <groupId>com.google.cloud.bigtable</groupId>
  <artifactId>bigtable-client-parent</artifactId>
  <version>1.28.0</version> <!-- {x-version-update:bigtable-client-parent:current} -->
  <packaging>pom</packaging>
  <name>${project.groupId}:${project.artifactId}</name>
  <url>https://cloud.google.com/bigtable/</url>
  <description>
    This is a client to access Cloud Bigtable
    (https://cloud.google.com/bigtable/) via the HBase APIs.
  </description>
  <!-- TODO: improve the description -->

  <parent>
    <groupId>com.google.cloud</groupId>
    <artifactId>google-cloud-shared-config</artifactId>
    <version>0.12.0</version>
  </parent>

  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <modules>
    <module>bigtable-client-core-parent</module>
    <module>bigtable-hbase-1.x-parent</module>
    <module>bigtable-hbase-2.x-parent</module>
    <module>bigtable-dataflow-parent</module>
    <module>bigtable-test</module>
  </modules>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <compileSource>1.7</compileSource>
    <compileSource.1.8>1.8</compileSource.1.8>

    <!-- core dependency versions -->
    <bigtable.version>1.27.1</bigtable.version>
    <hbase1-metrics.version>3.1.2</hbase1-metrics.version>
    <hbase2-metrics.version>3.2.6</hbase2-metrics.version>
    <!--  keeping at this version to align with hbase-->
    <slf4j.version>1.7.25</slf4j.version>
    <commons-logging.version>1.2</commons-logging.version>
    <jsr305.version>3.0.2</jsr305.version>
    <log4j2.version>2.17.1</log4j2.version>
    <protobuf.version>3.19.2</protobuf.version>

    <!-- hbase dependency versions -->
    <hbase.version.1>1.4.12</hbase.version.1>
    <hbase.version.2>2.2.3</hbase.version.2>
    <hbase.version>${hbase.version.1}</hbase.version>
    <hbase1-hadoop.version>2.7.4</hbase1-hadoop.version>
    <hbase2-hadoop.version>2.8.5</hbase2-hadoop.version>

    <!-- testing dependency versions -->
    <commons-lang.version>2.6</commons-lang.version>
    <junit.version>4.13.1</junit.version>
    <hamcrest.version>1.3</hamcrest.version>
    <mockito.version>3.6.0</mockito.version>
    <!-- TODO: check if commons-codec was transitively updated to 1.13 and okhttp was updated to 2.7.5 when upgrading-->
    <beam.version>2.24.0</beam.version>
    <!-- referred from bigtable-beam-import and bigtable-emulator -->
    <guava.version>30.1.1-android</guava.version>
    <beam-guava.version>20.0</beam-guava.version>
    <beam-auto-value.version>1.7</beam-auto-value.version>
    <gcs-guava.version>29.0-jre</gcs-guava.version>
    <beam-grpc.version>1.29.0</beam-grpc.version>

    <!-- Benchmarks related dependencies -->
    <jmh.version>1.23</jmh.version>
  </properties>

  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <scm>
    <connection>
      scm:git:git@github.com:googleapis/java-bigtable-hbase.git
    </connection>
    <developerConnection>
      scm:git:git@github.com:googleapis/java-bigtable-hbase.git
    </developerConnection>
    <url>https://github.com/googleapis/java-bigtable-hbase</url>
    <tag>HEAD</tag>
  </scm>

  <developers>
    <developer>
      <organization>Google</organization>
      <organizationUrl>http://www.google.com</organizationUrl>
    </developer>
  </developers>

  <issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/googleapis/java-bigtable-hbase/issues</url>
  </issueManagement>

  <build>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <!-- enable system property substitution. -->
        <filtering>true</filtering>
      </testResource>
    </testResources>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.0.0-M3</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
          <configuration>
            <source>${compileSource}</source>
            <target>${compileSource}</target>
            <showWarnings>true</showWarnings>
            <showDeprecation>false</showDeprecation>
            <compilerArgument>-Xlint:-options</compilerArgument>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.1.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.22.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.2.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-eclipse-plugin</artifactId>
          <version>2.10</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.2.0</version>
          <configuration>
            <doclint>none</doclint>
            <windowtitle>
              Cloud Bigtable HBase Client for Java ${project.version} API
            </windowtitle>
            <doctitle>
              Cloud Bigtable HBase Client for Java ${project.version} API
            </doctitle>
            <overview>../overview.html</overview>
            <bottom><![CDATA[<br>]]></bottom>

            <offlineLinks>
              <offlineLink>
                <url>
                  https://google.github.io/guava/releases/27.0-jre/api/docs/
                </url>
                <location>${basedir}/javadoc/guava-docs</location>
              </offlineLink>
              <offlineLink>
                <url>https://hbase.apache.org/2.0/devapidocs/</url>
                <location>${basedir}/javadoc/hbase-docs</location>
              </offlineLink>
              <offlineLink>
                <url>
                  https://static.javadoc.io/com.google.protobuf/protobuf-java/3.6.1/
                </url>
                <location>${basedir}/javadoc/protobuf-docs</location>
              </offlineLink>
            </offlineLinks>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
              <phase>package</phase>
              <configuration>
                <!--
                javadoc excluded packages:
                    com.google.clooud.*                             (Ignore, a hack/workaround for separate maven issue)
                -->
                <excludePackageNames>com.google.clooud</excludePackageNames>
              </configuration>
            </execution>
            <execution>
              <id>default-cli</id>
              <configuration>
                <!--
                javadoc excluded packages:
                    com.google.cloud.bigtable.beam{.sequencefiles}  (Breaks with javadoc:aggregate, handled separately)
                    com.google.cloud.bigtable.dataflow{import,}     (Breaks with javadoc:aggregate, handled separately)
                    com.google.clooud.*                             (Ignore, a hack/workaround for separate maven issue)
                -->
                <excludePackageNames>
                  com.google.cloud.bigtable.beam:com.google.cloud.bigtable.beam.sequencefiles:com.google.cloud.bigtable.dataflow:com.google.cloud.bigtable.dataflowimport:com.google.clooud
                </excludePackageNames>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>com.coveo</groupId>
        <artifactId>fmt-maven-plugin</artifactId>
        <version>2.9</version>
        <executions>
          <execution>
            <phase>process-sources</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <style>google</style>
        </configuration>
      </plugin>
      <!-- Define dependency-plugin for convenience, notably to easily check dependency tree from IntelliJ. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <configuration>
          <ignoreNonCompile>true</ignoreNonCompile>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-banned-deps</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <!-- ban all log4j 2.x deps with CVEs -->
                <bannedDependencies>
                  <excludes>
                    <exclude>org.apache.logging.log4j:*:[2.0-alpha1,2.17.0]</exclude>
                  </excludes>
                </bannedDependencies>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
