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

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

    <groupId>com.google.cloud.bigtable</groupId>
    <artifactId>bigtable-hbase-dataflow</artifactId>
    <packaging>jar</packaging>
    <name>${project.groupId}:${project.artifactId}</name>
    <description>
       This project contains artifacts that provide Cloud Bigtable client readers and writers in Google Cloud Dataflow.
    </description>

    <dependencies>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.4.2</version>
        </dependency>
        <dependency>
            <groupId>com.google.cloud.dataflow</groupId>
            <artifactId>google-cloud-dataflow-java-sdk-all</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.cloud.bigtable</groupId>
            <artifactId>bigtable-hbase-1.0</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>bigtableDataflowIntegrationTest</id>
            <dependencies>
                <dependency>
                    <groupId>org.mortbay.jetty.alpn</groupId>
                    <artifactId>alpn-boot</artifactId>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>api-integration-test</id>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <phase>none</phase>
                            </execution>
                            <execution>
                                <id>api-gap-test</id>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <phase>integration-test</phase>
                                <configuration>
                                    <!-- ALPN is needed for SSL engine rewrites -->
                                    <!-- to enable netty logging, include:
                                    -Djava.util.logging.config.file=src/test/resources/logging.properties
                                    -->
                                    <argLine>
                                        -Xbootclasspath/p:${settings.localRepository}/org/mortbay/jetty/alpn/alpn-boot/${alpn.version}/alpn-boot-${alpn.version}.jar
                                    </argLine>
                                    <forkCount>1</forkCount>
                                    <includes>
                                        <include>**/CloudBigtableIOIntegrationTest.java</include>
                                    </includes>
                                    <reportNameSuffix>bigtable-server</reportNameSuffix>
                                    <systemPropertyVariables>
                                        <bigtable.test.extra.resources>bigtable-test.xml</bigtable.test.extra.resources>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <windowtitle>Google Cloud Dataflow + Cloud Bigtable Connector ${project.version} API</windowtitle>
                            <doctitle>Google Cloud Dataflow + Cloud Bigtable Connector ${project.version} API</doctitle>
                            <overview>../overview.html</overview>
                            <bottom><![CDATA[<br>]]></bottom>

                            <offlineLinks>
                                <offlineLink>
                                    <url>https://cloud.google.com/dataflow/java-sdk/JavaDoc/</url>
                                    <location>${basedir}/javadoc/dataflow-docs</location>
                                </offlineLink>
                                <offlineLink>
                                    <url>http://hbase.apache.org/apidocs/</url>
                                    <location>${basedir}/javadoc/hbase-docs</location>
                                </offlineLink>
                            </offlineLinks>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <phase>package</phase>
                            </execution>
                        </executions>
                    </plugin>
               </plugins>
           </build>
        </profile>
    </profiles>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <useProjectReferences>false</useProjectReferences>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <excludes>
                                <exclude>**/*IntegrationTest.java</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
