<?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>com.aliyun.odps</groupId>
        <artifactId>cupid-spark-2.x</artifactId>
        <version>3.3.8-public</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <groupId>com.aliyun.odps</groupId>
    <artifactId>streaming-lib</artifactId>
    <version>3.3.8-public</version>
    <packaging>jar</packaging>
    <name>streaming-lib</name>

    <properties>
        <spark.version>2.3.0</spark.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.aliyun.odps</groupId>
            <artifactId>cupid-sdk</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_${scala.binary.version}</artifactId>
            <version>${spark.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-sql_${scala.binary.version}</artifactId>
            <version>${spark.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-catalyst_${scala.binary.version}</artifactId>
            <version>${spark.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.json4s</groupId>
            <artifactId>json4s-native_${scala.binary.version}</artifactId>
            <version>3.2.11</version>
        </dependency>
        <dependency>
            <groupId>net.debasishg</groupId>
            <artifactId>redisclient_${scala.binary.version}</artifactId>
            <version>3.5</version>
        </dependency>
        <dependency>
            <groupId>com.aliyun.openservices</groupId>
            <artifactId>aliyun-log</artifactId>
            <version>0.6.15</version>
        </dependency>
        <dependency>
            <groupId>com.aliyun.openservices</groupId>
            <artifactId>log-loghub-producer</artifactId>
            <version>0.1.11</version>
        </dependency>
        <dependency>
            <groupId>com.aliyun.datahub</groupId>
            <artifactId>aliyun-sdk-datahub</artifactId>
            <version>2.9.2-public</version>
            <exclusions>
                <exclusion>
                    <groupId>net.jpountz.lz4</groupId>
                    <artifactId>lz4</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>alibaba</id>
            <dependencies>
                <dependency>
                    <groupId>com.alibaba.cdo</groupId>
                    <artifactId>timetunnel-clientng</artifactId>
                    <exclusions>
                        <exclusion>
                            <groupId>io.netty</groupId>
                            <artifactId>netty</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>public</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.alchim31.maven</groupId>
                        <artifactId>scala-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>scala-compile-first</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>scala-test-compile-first</id>
                                <phase>process-test-resources</phase>
                                <goals>
                                    <goal>testCompile</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>attach-scaladocs</id>
                                <phase>site</phase>
                                <goals>
                                    <goal>doc-jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <excludes>
                                <exclude>**/org/apache/spark/streaming/tt/*</exclude>
                                <exclude>**/org/apache/spark/streaming/util/*</exclude>
                            </excludes>
                            <scalaVersion>${scala.version}</scalaVersion>
                            <recompileMode>incremental</recompileMode>

                            <args>
                                <arg>-unchecked</arg>
                                <arg>-deprecation</arg>
                                <arg>-feature</arg>
                            </args>
                            <jvmArgs>
                                <jvmArg>-Xms1024m</jvmArg>
                                <jvmArg>-Xmx1024m</jvmArg>
                                <jvmArg>-XX:PermSize=${PermGen}</jvmArg>
                                <jvmArg>-XX:MaxPermSize=${MaxPermGen}</jvmArg>
                            </jvmArgs>
                            <javacArgs>
                                <javacArg>-source</javacArg>
                                <javacArg>${java.version}</javacArg>
                                <javacArg>-target</javacArg>
                                <javacArg>${java.version}</javacArg>
                            </javacArgs>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
