<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You 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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.zto.fire</groupId>
    <artifactId>fire-parent</artifactId>
    <packaging>pom</packaging>
    <version>2.3.3</version>
    <name>Fire : </name>
    <description>Fire framework is a development framework for real-time computing task development . The framework provides a simple and easy to use API that can significantly reduce the development threshold of Spark and Flink and improve development efficiency.</description>
    <url>https://github.com/fire-framework/fire</url>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>longyin319</name>
            <email>longyin319@foxmail.com</email>
            <organization>fire-framework</organization>
            <organizationUrl>https://github.com/fire-framework/fire</organizationUrl>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/fire-framework/fire</url>
        <connection>scm:git:https://github.com/fire-framework/fire.git</connection>
        <developerConnection>scm:git:https://github.com/fire-framework/fire.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <properties>
        <fire.version>${project.version}</fire.version>
        <hudi.version>0.9.0</hudi.version>
        <commons-lang.version>2.5</commons-lang.version>
        <clickhouse-jdbc.version>0.3.1</clickhouse-jdbc.version>
        <maven.scope>provided</maven.scope>
        <kafka.version>0.11.0.2</kafka.version>
        <sparkjava.version>2.8.0</sparkjava.version>
        <hadoop.version>2.6.0</hadoop.version>
        <hive.apache.version>1.1.0</hive.apache.version>
        <hive.flink.version>1.2.1</hive.flink.version>
        <hive.version>1.1.0</hive.version>
        <hive.group>org.apache.hive</hive.group>
        <hbase.version>1.2.0</hbase.version>
        <impala.jdbc.version>2.5.30</impala.jdbc.version>
        <junit.version>4.13.2</junit.version>
        <rocketmq.version>4.8.0</rocketmq.version>
        <mysql.version>5.1.49</mysql.version>
        <guava.version>15.0</guava.version>
        <curator.verrsion>2.6.0</curator.verrsion>
        <arthas.version>3.5.4</arthas.version>
        <calcite.version>1.26.0</calcite.version>
        <netty.version>4.1.17.Final</netty.version>
        <aspectj.version>1.9.7</aspectj.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <contains.scala.binary.version>_${scala.binary.version}</contains.scala.binary.version>
        <scala.version>${scala.binary.version}.${scala.minor.version}</scala.version>
        <spark.reference>${spark.major.version}_${scala.binary.version}</spark.reference>
        <flink.reference>${flink.major.version}_${scala.binary.version}</flink.reference>
    </properties>

    <modules>
        <module>fire-common</module>
        <module>fire-core</module>
        <module>fire-connectors</module>
        <module>fire-engines</module>
        <module>fire-enhance</module>
    </modules>

    <profiles>
        <!-- Configure whether to build the fire-examples module. -->
        <profile>
            <id>build-examples</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <modules>
                <module>fire-examples</module>
            </modules>
        </profile>

        <!-- Configure whether to build the fire-shell module. -->
        <profile>
            <id>build-shell</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <modules>
                <module>fire-shell</module>
            </modules>
        </profile>

        <!-- scala profile -->
        <profile>
            <id>scala-2.11</id>
            <properties>
                <scala.binary.version>2.11</scala.binary.version>
                <scala.minor.version>8</scala.minor.version>
            </properties>
        </profile>

        <profile>
            <id>scala-2.12</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <scala.binary.version>2.12</scala.binary.version>
                <scala.minor.version>13</scala.minor.version>
            </properties>
        </profile>

        <profile>
            <id>scala-2.13</id>
            <properties>
                <scala.binary.version>2.13</scala.binary.version>
                <scala.minor.version>10</scala.minor.version>
            </properties>
        </profile>

        <!-- spark profile -->
        <profile>
            <id>spark-2.3</id>
            <properties>
                <spark.version>2.3.2</spark.version>
                <spark.major.version>2.3</spark.major.version>
                <jackson.version>2.6.7</jackson.version>
            </properties>
        </profile>
        <profile>
            <id>spark-2.4</id>
            <properties>
                <spark.version>2.4.8</spark.version>
                <spark.major.version>2.4</spark.major.version>
                <jackson.version>2.6.7</jackson.version>
            </properties>
        </profile>
        <profile>
            <id>spark-3.0</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <spark.version>3.0.2</spark.version>
                <spark.major.version>3.0</spark.major.version>
                <jackson.version>2.10.5</jackson.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-avro_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>spark-3.1</id>
            <properties>
                <spark.version>3.1.3</spark.version>
                <spark.major.version>3.1</spark.major.version>
                <jackson.version>2.10.5</jackson.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-avro_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>spark-3.2</id>
            <properties>
                <spark.version>3.2.3</spark.version>
                <spark.major.version>3.2</spark.major.version>
                <jackson.version>2.10.5</jackson.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-avro_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>spark-3.3</id>
            <properties>
                <spark.version>3.3.1</spark.version>
                <spark.major.version>3.3</spark.major.version>
                <jackson.version>2.10.5</jackson.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-avro_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
            </dependencies>
        </profile>

        <!-- 以hadoop2.7、hive1.2低版本编译 -->
        <profile>
            <id>hadoop-2.7</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <hive.group>org.spark-project.hive</hive.group>
                <hive.version>1.2.1.spark2</hive.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-hive_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>${maven.scope}</scope>
                    <exclusions>
                        <exclusion>
                            <groupId>org.apache.hive</groupId>
                            <artifactId>hive-common</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>org.apache.hive</groupId>
                            <artifactId>hive-exec</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>org.apache.hive</groupId>
                            <artifactId>hive-metastore</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>org.apache.hive</groupId>
                            <artifactId>hive-serde</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>org.apache.hive</groupId>
                            <artifactId>hive-shims</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-hive-thriftserver_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>${maven.scope}</scope>
                    <exclusions>
                        <exclusion>
                            <groupId>org.apache.hive</groupId>
                            <artifactId>hive-cli</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>org.apache.hive</groupId>
                            <artifactId>hive-jdbc</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>org.apache.hive</groupId>
                            <artifactId>hive-beeline</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>${hive.group}</groupId>
                    <artifactId>hive-cli</artifactId>
                    <version>${hive.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>${hive.group}</groupId>
                    <artifactId>hive-jdbc</artifactId>
                    <version>${hive.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>${hive.group}</groupId>
                    <artifactId>hive-beeline</artifactId>
                    <version>${hive.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>

                <dependency>
                    <groupId>${hive.group}</groupId>
                    <artifactId>hive-common</artifactId>
                    <version>${hive.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>${hive.group}</groupId>
                    <artifactId>hive-metastore</artifactId>
                    <version>${hive.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>${hive.group}</groupId>
                    <artifactId>hive-exec</artifactId>
                    <version>${hive.version}</version>
                    <scope>${maven.scope}</scope>
                    <exclusions>
                        <exclusion>
                            <groupId>org.apache.commons</groupId>
                            <artifactId>commons-lang3</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>org.apache.spark</groupId>
                            <artifactId>spark-core_2.10</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>hadoop-3.2</id>
            <properties>
                <hadoop.version>3.2.0</hadoop.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-hive_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
            </dependencies>
        </profile>

        <!-- flink profile -->
        <profile>
            <id>flink-1.12</id>
            <properties>
                <flink.version>1.12.2</flink.version>
                <flink.major.version>1.12</flink.major.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.flink</groupId>
                    <artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
                    <version>${flink.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.flink</groupId>
                    <artifactId>flink-queryable-state-runtime_${scala.binary.version}</artifactId>
                    <version>${flink.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.flink</groupId>
                    <artifactId>flink-runtime_${scala.binary.version}</artifactId>
                    <version>${flink.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>flink-1.13</id>
            <properties>
                <flink.version>1.13.0</flink.version>
                <flink.major.version>1.13</flink.major.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.flink</groupId>
                    <artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
                    <version>${flink.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.flink</groupId>
                    <artifactId>flink-queryable-state-runtime_${scala.binary.version}</artifactId>
                    <version>${flink.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.flink</groupId>
                    <artifactId>flink-runtime_${scala.binary.version}</artifactId>
                    <version>${flink.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>flink-1.14</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <flink.version>1.14.3</flink.version>
                <flink.major.version>1.14</flink.major.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.flink</groupId>
                    <artifactId>flink-table-planner_${scala.binary.version}</artifactId>
                    <version>${flink.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.flink</groupId>
                    <artifactId>flink-queryable-state-runtime</artifactId>
                    <version>${flink.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>flink-1.15</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <flink.version>1.15.3</flink.version>
                <flink.major.version>1.15</flink.major.version>
                <contains.scala.binary.version></contains.scala.binary.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.flink</groupId>
                    <artifactId>flink-table-planner_${scala.binary.version}</artifactId>
                    <version>${flink.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.flink</groupId>
                    <artifactId>flink-queryable-state-runtime</artifactId>
                    <version>${flink.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>flink-1.16</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <flink.version>1.16.0</flink.version>
                <flink.major.version>1.16</flink.major.version>
                <contains.scala.binary.version></contains.scala.binary.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.flink</groupId>
                    <artifactId>flink-table-planner_${scala.binary.version}</artifactId>
                    <version>${flink.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.flink</groupId>
                    <artifactId>flink-queryable-state-runtime</artifactId>
                    <version>${flink.version}</version>
                    <scope>${maven.scope}</scope>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>build-deploy</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.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-javadoc-plugin</artifactId>
                        <version>2.9.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <failOnError>false</failOnError>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </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>net.ju-n.maven.plugins</groupId>
                        <artifactId>checksum-maven-plugin</artifactId>
                        <version>1.2</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>artifacts</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.version}</version>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-compiler</artifactId>
            <version>${scala.version}</version>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-reflect</artifactId>
            <version>${scala.version}</version>
        </dependency>

        <!-- 第三方库相关依赖 -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
            <scope>${maven.scope}</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
            <scope>${maven.scope}</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
            <scope>${maven.scope}</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.5</version>
            <scope>${maven.scope}</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
            <scope>${maven.scope}</scope>
        </dependency>
        <dependency>
            <groupId>com.esotericsoftware</groupId>
            <artifactId>kryo</artifactId>
            <version>4.0.0</version>
            <scope>${maven.scope}</scope>
        </dependency>
        <dependency>
            <groupId>com.sparkjava</groupId>
            <artifactId>spark-core</artifactId>
            <version>${sparkjava.version}</version>
        </dependency>
        <dependency>
            <groupId>org.quartz-scheduler</groupId>
            <artifactId>quartz</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>com.github.oshi</groupId>
            <artifactId>oshi-core</artifactId>
            <version>3.12.2</version>
            <scope>${maven.scope}</scope>
        </dependency>

        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>${aspectj.version}</version>
            <scope>${maven.scope}</scope>
        </dependency>

        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>${aspectj.version}</version>
            <scope>${maven.scope}</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>cloudera</id>
            <url>https://repository.cloudera.com/artifactory/cloudera-repos</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>aliyun</id>
            <url>https://maven.aliyun.com/repository/central</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>central</id>
            <url>https://mirrors.huaweicloud.com/repository/maven/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>cloudera</id>
            <url>https://repository.cloudera.com/artifactory/cloudera-repos</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>aliyun</id>
            <url>https://maven.aliyun.com/repository/central</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>central</id>
            <url>https://mirrors.huaweicloud.com/repository/maven/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.7</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <!-- ensure that we use JDK 1.6 -->
            <plugin>
                <inherited>true</inherited>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.scala-tools</groupId>
                <artifactId>maven-scala-plugin</artifactId>
                <version>2.15.2</version>
                <executions>
                    <!-- Run scala compiler in the process-resources phase, so that dependencies
                        on scala classes can be resolved later in the (Java) compile phase -->
                    <execution>
                        <id>scala-compile-first</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>

                    <!-- Run scala compiler in the process-test-resources phase, so that
                        dependencies on scala classes can be resolved later in the (Java) test-compile
                        phase -->
                    <execution>
                        <id>scala-test-compile</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <!-- Add src/main/scala to source path of Eclipse -->
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/main/java</source>
                                <source>src/main/scala</source>
                                <source>src/main/java-spark-${spark.major.version}</source>
                                <source>src/main/scala-spark-${spark.major.version}</source>
                                <source>src/main/java-flink-${flink.major.version}</source>
                                <source>src/main/scala-flink-${flink.major.version}</source>
                            </sources>
                        </configuration>
                    </execution>

                    <!-- Add src/test/scala to test source path of Eclipse -->
                    <execution>
                        <id>add-test-source</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/test/java</source>
                                <source>src/test/scala</source>
                                <source>src/test/java-spark-${spark.major.version}</source>
                                <source>src/test/scala-spark-${spark.major.version}</source>
                                <source>src/test/java-flink-${flink.major.version}</source>
                                <source>src/test/scala-flink-${flink.major.version}</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- to generate Eclipse artifacts for projects mixing Scala and Java -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.10</version>
                <configuration>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>true</downloadJavadocs>
                    <projectnatures>
                        <projectnature>org.scala-ide.sdt.core.scalanature</projectnature>
                        <projectnature>org.eclipse.jdt.core.javanature</projectnature>
                    </projectnatures>
                    <buildcommands>
                        <buildcommand>org.scala-ide.sdt.core.scalabuilder</buildcommand>
                    </buildcommands>
                    <classpathContainers>
                        <classpathContainer>org.scala-ide.sdt.launching.SCALA_CONTAINER</classpathContainer>
                        <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
                    </classpathContainers>
                    <excludes>
                        <!-- in Eclipse, use scala-library, scala-compiler from the SCALA_CONTAINER
                            rather than POM <dependency> -->
                        <exclude>org.scala-lang:scala-library</exclude>
                        <exclude>org.scala-lang:scala-compiler</exclude>
                    </excludes>
                    <sourceIncludes>
                        <sourceInclude>**/*.scala</sourceInclude>
                        <sourceInclude>**/*.java</sourceInclude>
                    </sourceIncludes>
                </configuration>
            </plugin>

            <!-- When run tests in the test phase, include .java and .scala source
                files -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <includes>
                        <include>**/*.java</include>
                        <include>**/*.scala</include>
                    </includes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
                <version>1.14.0</version>
                <configuration>
                    <complianceLevel>1.8</complianceLevel>
                    <source>1.8</source>
                    <target>1.8</target>
                    <showWeaveInfo>true</showWeaveInfo>
                    <Xlint>ignore</Xlint>
                    <encoding>UTF-8</encoding>
                    <skip>true</skip>
                    <forceAjcCompile>true</forceAjcCompile>
                    <weaveDirectories>
                        <weaveDirectory>${project.build.outputDirectory}</weaveDirectory>
                    </weaveDirectories>
                </configuration>
                <executions>
                    <execution>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.4.2</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>META-INF/*.SF</exclude>
                                <exclude>META-INF/*.DSA</exclude>
                                <exclude>META-INF/*.RSA</exclude>
                            </excludes>
                        </filter>
                    </filters>
                    <transformers combine.children="append">
                        <transformer
                                implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer">
                        </transformer>
                    </transformers>
                    <finalName>zto-${project.artifactId}-${project.version}</finalName>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
