<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.klarna</groupId>
    <artifactId>hiverunner</artifactId>
    <version>3.2.1</version>
    <packaging>jar</packaging>
    <name>HiveRunner</name>
    <description>HiveRunner is a unit test framework based on JUnit4 and enables TDD development of HiveQL without the need of any installed dependencies.</description>
    <url>https://github.com/klarna/HiveRunner</url>

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

    <developers>
        <developer>
            <name>Per Ullberg</name>
            <organization>Klarna</organization>
            <organizationUrl>http://www.klarna.com</organizationUrl>
        </developer>
        <developer>
            <name>Thomas Larsson</name>
            <organization>Klarna</organization>
            <organizationUrl>http://www.klarna.com</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/klarna/HiveRunner.git</connection>
        <developerConnection>scm:git:https://github.com/klarna/HiveRunner.git</developerConnection>
        <url>git@github.com:klarna/HiveRunner.git</url>
        <tag>HEAD</tag>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <tez.version>0.7.0</tez.version>
        <hive.version>1.2.1</hive.version>
        <hive.execution.engine>mr</hive.execution.engine>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.hive</groupId>
            <artifactId>hive-serde</artifactId>
            <version>${hive.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.hive</groupId>
            <artifactId>hive-jdbc</artifactId>
            <version>${hive.version}</version>
        </dependency>
        
        <dependency>
            <groupId>org.apache.hive.hcatalog</groupId>
            <artifactId>hive-webhcat-java-client</artifactId>
            <version>${hive.version}</version>
        </dependency>


        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>2.3.1</version>
        </dependency>

        <dependency>
            <groupId>org.apache.hive</groupId>
            <artifactId>hive-service</artifactId>
            <version>${hive.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>derby</artifactId>
                    <groupId>org.apache.derby</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>datanucleus-api-jdo</artifactId>
                    <groupId>org.datanucleus</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>datanucleus-core</artifactId>
                    <groupId>org.datanucleus</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>datanucleus-rdbms</artifactId>
                    <groupId>org.datanucleus</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>bonecp</artifactId>
                    <groupId>com.jolbox</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>calcite-core</artifactId>
                    <groupId>org.apache.calcite</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>calcite-avatica</artifactId>
                    <groupId>org.apache.calcite</groupId>
                </exclusion>
            </exclusions>
        </dependency>


        <!-- The latest versions of datanucleus seems to be faster than the one included in hive -->
        <dependency>
            <artifactId>datanucleus-api-jdo</artifactId>
            <groupId>org.datanucleus</groupId>
            <version>3.2.8</version>
        </dependency>


        <dependency>
            <artifactId>tez-dag</artifactId>
            <groupId>org.apache.tez</groupId>
            <version>${tez.version}</version>
        </dependency>

        <dependency>
            <artifactId>tez-common</artifactId>
            <groupId>org.apache.tez</groupId>
            <version>${tez.version}</version>
        </dependency>

        <dependency>
            <artifactId>tez-mapreduce</artifactId>
            <groupId>org.apache.tez</groupId>
            <version>${tez.version}</version>
        </dependency>

        <dependency>
            <artifactId>datanucleus-core</artifactId>
            <groupId>org.datanucleus</groupId>
            <version>3.2.12</version>
        </dependency>

        <dependency>
            <artifactId>datanucleus-rdbms</artifactId>
            <groupId>org.datanucleus</groupId>
            <version>3.2.11</version>
        </dependency>

        <dependency>
            <groupId>org.apache.hive</groupId>
            <artifactId>hive-contrib</artifactId>
            <version>${hive.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
            <version>0.9.8</version>
        </dependency>

        <!-- Always put this before JUnit or the class loader might load the wrong Matcher -->
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.9.5</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <!-- forkMode:always resolves OOM error when running unit tests -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.17</version>
                <configuration>
                    <!-- Hiverunner need this for some queries-->
                    <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
                    <systemProperties>
                        <!--
                        Any hive conf property may be overridden here by suffixing it with 'hiveconf_'
                        -->
                        <hiveconf_hive.execution.engine>${hive.execution.engine}</hiveconf_hive.execution.engine>
                        <hiveconf_hive.exec.counters.pull.interval>1000</hiveconf_hive.exec.counters.pull.interval>
                        <enableTimeout>false</enableTimeout>
                        <timeoutSeconds>30</timeoutSeconds>
                        <timeoutRetries>2</timeoutRetries>
                    </systemProperties>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
           <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.3</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
           </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.4</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.0.0</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <homedir>${project.basedir}</homedir>
                                    <passphrase>${env.GPG_PASSPHRASE}</passphrase>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>tez</id>
            <properties>
                <hive.execution.engine>tez</hive.execution.engine>
            </properties>
        </profile>
    </profiles>
</project>
