<?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.18.3-public</version>
    <packaging>pom</packaging>
    <name>odps-sdk-java</name>
    <description>Aliyun ODPS SDK for Java Developers</description>
    <url>http://odps.aliyun.com</url>

    <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>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <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>
        <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>${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.6</source>
                    <target>1.6</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.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>2.4</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>
                </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>com.jcabi</groupId>
                <artifactId>jcabi-maven-plugin</artifactId>
                <version>0.12</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>ajc</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.14</version>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <configuration>
                            <configLocation>check_style.xml</configLocation>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                            <linkXRef>false</linkXRef>
                        </configuration>
                        <!-- <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>
