<?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.sonatype.oss</groupId>
      <artifactId>oss-parent</artifactId>
      <version>7</version>
    </parent>

    <scm>
        <connection>scm:git:http://github.com/aliyun/aliyun-odps-java-sdk.git</connection>
        <developerConnection>scm:git:git@github.com:aliyun/aliyun-odps-java-sdk.git</developerConnection>
        <url>http://github.com/aliyun/aliyun-odps-java-sdk</url>
    </scm>

    <groupId>com.aliyun.odps</groupId>
    <artifactId>odps</artifactId>
    <version>0.36.4-public</version>
    <packaging>pom</packaging>
    <name>odps-sdk-java</name>
    <description>Aliyun ODPS SDK for Java Developers</description>
    <url>http://odps.aliyun.com</url>

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

    <organization>
        <name>Alibaba Cloud Computing</name>
        <url>http://www.aliyun.com</url>
    </organization>

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

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.aliyun.odps</groupId>
                <artifactId>odps-sdk-commons</artifactId>
                <version>0.36.4-public</version>
            </dependency>

            <dependency>
                <groupId>com.aliyun.odps</groupId>
                <artifactId>odps-sdk-core</artifactId>
                <version>0.36.4-public</version>
            </dependency>

            <dependency>
                <groupId>com.aliyun.odps</groupId>
                <artifactId>odps-sdk-mapred</artifactId>
                <version>0.36.4-public</version>
            </dependency>

            <dependency>
                <groupId>com.aliyun.odps</groupId>
                <artifactId>odps-lot-proto</artifactId>
                <version>0.36.4-public</version>
            </dependency>

            <dependency>
                <groupId>com.aliyun.odps</groupId>
                <artifactId>odps-sdk-lot</artifactId>
                <version>0.36.4-public</version>
            </dependency>

            <dependency>
                <groupId>com.aliyun.odps</groupId>
                <artifactId>odps-sdk-graph</artifactId>
                <version>0.36.4-public</version>
            </dependency>

            <dependency>
                <groupId>com.aliyun.odps</groupId>
                <artifactId>odps-common-local</artifactId>
                <version>0.36.4-public</version>
            </dependency>

            <dependency>
                <groupId>com.aliyun.odps</groupId>
                <artifactId>odps-sdk-udf</artifactId>
                <version>0.36.4-public</version>
            </dependency>

            <dependency>
                <groupId>com.aliyun.odps</groupId>
                <artifactId>odps-mapred-bridge</artifactId>
                <version>0.36.4-public</version>
            </dependency>

            <dependency>
                <groupId>org.apache.velocity</groupId>
                <artifactId>velocity</artifactId>
                <version>1.7</version>
            </dependency>

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

            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>1.2</version>
            </dependency>

            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.4</version>
            </dependency>

            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>2.6</version>
            </dependency>

            <dependency>
                <groupId>com.github.fommil.netlib</groupId>
                <artifactId>all</artifactId>
                <version>1.1.2</version>
                <type>pom</type>
            </dependency>

            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>2.2.4</version>
            </dependency>

            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java</artifactId>
                <version>2.4.1</version>
            </dependency>

            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjrt</artifactId>
                <version>1.8.9</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.7.5</version>
            </dependency>

            <dependency>
                <groupId>com.github.stephenc.jcip</groupId>
                <artifactId>jcip-annotations</artifactId>
                <version>1.0-1</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>4.5.2</version>
                <scope>test</scope>
            </dependency>

            <!-- Base64 -->
            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>1.9</version>
            </dependency>

            <dependency>
                <groupId>org.codehaus.jackson</groupId>
                <artifactId>jackson-mapper-asl</artifactId>
                <version>1.9.13</version>
            </dependency>

            <dependency>
                <groupId>net.sourceforge.javacsv</groupId>
                <artifactId>javacsv</artifactId>
                <version>2.0</version>
            </dependency>

            <dependency>
                <groupId>org.xerial.snappy</groupId>
                <artifactId>snappy-java</artifactId>
                <version>1.1.1.6</version>
            </dependency>

            <dependency>
                <groupId>javax.mail</groupId>
                <artifactId>mail</artifactId>
                <version>1.4.7</version>
            </dependency>

            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>15.0</version>
            </dependency>

            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>1.10.8</version>
                <!-- mockito's dependency on hamcrest conflict to junit 4.11, exclude
                    that. -->
                <exclusions>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-core</artifactId>
                    </exclusion>
                </exclusions>
                <scope>test</scope>
            </dependency>

            <!--volumefs-->
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-common</artifactId>
                <version>2.7.1</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-common</artifactId>
                <version>2.7.1</version>
                <scope>test</scope>
                <type>test-jar</type>
            </dependency>

            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-compress</artifactId>
                <version>1.4</version>
            </dependency>

            <dependency>
                <groupId>commons-cli</groupId>
                <artifactId>commons-cli</artifactId>
                <version>1.3.1</version>
            </dependency>

            <dependency>
                <groupId>net.sourceforge.javacsv</groupId>
                <artifactId>javacsv</artifactId>
                <version>2.0</version>
            </dependency>

            <dependency>
                <groupId>com.googlecode.java-diff-utils</groupId>
                <artifactId>diffutils</artifactId>
                <version>1.2.1</version>
                <scope>test</scope>
            </dependency>

            <!-->Dependencies for simple-xml<-->
            <dependency>
                <groupId>stax</groupId>
                <artifactId>stax-api</artifactId>
                <version>1.0.1</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>stax</groupId>
                <artifactId>stax</artifactId>
                <version>1.2.0</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>xpp3</groupId>
                <artifactId>xpp3</artifactId>
                <version>1.1.3.3</version>
                <scope>compile</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <modules>
        <module>odps-sdk</module>
        <!-- MR on SQL -->
        <module>odps-sdk-impl</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <profiles>
        <profile>
            <id>doclint-java8-disable</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <properties>
                <javadoc.opts>-Xdoclint:none</javadoc.opts>
            </properties>
        </profile>
    </profiles>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.10.4</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.2.1</version>
                    <configuration>
                        <artifactSet>
                            <includes>
                                <include>com.google.protobuf:protobuf-java:jar:</include>
                            </includes>
                        </artifactSet>
                        <relocations>
                            <relocation>
                                <pattern>com.google.protobuf</pattern>
                                <shadedPattern>com.aliyun.odps.thirdparty.com.google.protobuf</shadedPattern>
                            </relocation>
                        </relocations>
                        <shadedArtifactAttached>true</shadedArtifactAttached>
                        <shadedClassifierName>shaded</shadedClassifierName>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Specification-Version>${version}</Specification-Version>
                            <Implementation-Version>${version}</Implementation-Version>
                            <Build-Time>${maven.build.timestamp}</Build-Time>
                            <Build-path>${basedir}</Build-path>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                    <optimize>true</optimize>
                    <debug>true</debug>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <deployAtEnd>true</deployAtEnd>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>nexus-releases</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <additionalConfig>
                        <file>
                            <name>.settings/org.eclipse.core.resources.prefs</name>
                            <content>
                                <![CDATA[eclipse.preferences.version=1${line.separator}encoding/<project>=${project.build.sourceEncoding}${line.separator}]]>
                            </content>
                        </file>
                    </additionalConfig>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <charset>UTF-8</charset>
                    <docencoding>UTF-8</docencoding>
                    <author>false</author>
                    <show>public</show>
                    <additionalparam>${javadoc.opts}</additionalparam>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <inherited>false</inherited>
                <configuration>
                    <tasks>
                        <junitreport todir="target/surefire-reports">
                            <fileset dir="target/surefire-reports">
                                <include name="**/*.xml"/>
                            </fileset>
                            <report format="noframes" todir="target/junit-report"/>
                        </junitreport>
                    </tasks>
                </configuration>
                <goals>
                    <goal>run</goal>
                </goals>
                <dependencies>
                    <dependency>
                        <groupId>ant</groupId>
                        <artifactId>ant-junit</artifactId>
                        <version>1.6.2</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.14</version>
                <configuration>
                    <configLocation>check_style.xml</configLocation>
                    <encoding>UTF-8</encoding>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>true</failsOnError>
                    <linkXRef>false</linkXRef>
                    <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <!-- <goals> -->
                        <!--   <goal>checkstyle::check</goal> -->
                        <!-- </goals> -->
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.17</version>
                <configuration>
                    <parallel>classes</parallel>
                    <threadCountClasses>20</threadCountClasses>
                    <forkCount>3</forkCount>
                    <useUnlimitedThreads>true</useUnlimitedThreads>
                    <reuseForks>false</reuseForks>
                </configuration>
            </plugin>

        </plugins>
    </build>

</project>
