<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2014 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>

    <parent>
        <groupId>com.google.cloud.bigtable</groupId>
        <artifactId>bigtable-client</artifactId>
        <version>0.1.9</version>
    </parent>

    <artifactId>bigtable-hbase-1.0</artifactId>
    <packaging>jar</packaging>
    <name>${project.groupId}:${project.artifactId}</name>
    <description>
       This project contains hbase 1.0 specific implementation of bigtable hbase.
    </description>

    <properties>
        <hbase.version>1.0.1</hbase.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>${protobuff-java.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>bigtable-hbase</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.hbase</groupId>
            <artifactId>hbase-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-common</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.hbase</groupId>
            <artifactId>hbase-common</artifactId>
        </dependency>
    </dependencies>
    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <!-- enable project.version substitution. -->
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>com.google.cloud.bigtable.mapreduce.Driver</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <id>enforce-banned-dependencies</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <exclude>com.google.guava:guava-jdk5:*</exclude>
<!-- This needs to work in the near future
                                        <exclude>io.netty:netty-all:*</exclude>
                                        <exclude>io.netty:netty:*</exclude>
-->
                                    </excludes>
                                    <includes>
                                        <include>com.google.guava:guava:${guava.version}</include>
                                        <include>io.nett:*:${netty.version}</include>
                                    </includes>
                                </bannedDependencies>
                           </rules>
                          <fail>true</fail>
                      </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadeTestJar>true</shadeTestJar>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>shaded</shadedClassifierName>
                            <createDependencyReducedPom>true</createDependencyReducedPom>
                            <artifactSet>
                                <includes>
                                    <include>com.google.cloud.bigtable:bigtable-protos</include>
                                    <include>com.google.cloud.bigtable:bigtable-grpc-interface</include>
                                    <include>com.google.cloud.bigtable:bigtable-hbase</include>
                                    <include>com.google.api-client:*</include>
                                    <include>com.google.auth:*</include>
                                    <include>com.google.guava:guava</include>
                                    <include>com.google.http-client:*</include>
                                    <include>com.google.oauth-client:*</include>
                                    <include>com.google.protobuf:*</include>
                                    <include>com.twitter:hpack</include>
                                    <include>com.fasterxml.jackson.core:*</include>
                                    <include>io.netty:netty-codec-http2</include>
                                    <include>io.netty:netty-codec-http</include>
                                    <include>io.netty:netty-codec</include>
                                    <include>io.netty:netty-handler</include>
                                    <include>io.netty:netty-buffer</include>
                                    <include>io.netty:netty-common</include>
                                    <include>io.netty:netty-transport</include>
                                    <include>io.netty:netty-resolver</include>
                                    <include>io.grpc:grpc-all</include>
                                </includes>
                            </artifactSet>
                            <relocations>
                                <relocation>
                                    <pattern>com.google.common</pattern>
                                    <shadedPattern>com.google.bigtable.repackaged.com.google.common</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.google.protobuf</pattern>
                                    <shadedPattern>com.google.bigtable.repackaged.com.google.protobuf</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.fasterxml</pattern>
                                    <shadedPattern>com.google.bigtable.repackaged.com.fasterxml</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>org.apache.commons.codec</pattern>
                                    <shadedPattern>com.google.bigtable.repackaged.org.apache.commons.codec</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>io.netty</pattern>
                                    <shadedPattern>com.google.bigtable.repackaged.io.netty</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.google.api</pattern>
                                    <shadedPattern>com.google.bigtable.repackaged.com.google.api</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
