<?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>

    <groupId>com.intel.analytics.bigdl</groupId>
    <artifactId>bigdl-parent-spark_2.4.6</artifactId>
    <packaging>pom</packaging>
    <version>2.2.0</version>

    <name>BigDL</name>
    <description>Big Data AI platform for distributed TensorFlow and PyTorch on Apache Spark.</description>
    <url>https://github.com/intel-analytics/BigDL</url>

    <developers>
        <developer>
            <name>Jason Dai</name>
            <email>jason.dai@intel.com</email>
            <organization>Intel</organization>
            <organizationUrl>http://www.intel.com</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:intel-analytics/BigDL.git</connection>
        <url>https://github.com/intel-analytics/BigDL/tree/master</url>
    </scm>

    <repositories>
        <repository>
            <id>central</id>
            <name>Maven Repository</name>
            <url>https://repo1.maven.org/maven2</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>apache-repo</id>
            <name>Apache Repository</name>
            <url>https://repository.apache.org/content/repositories/releases</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>jboss-repo</id>
            <name>JBoss Repository</name>
            <url>https://repository.jboss.org/nexus/content/repositories/releases</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>sonatype</id>
            <name>sonatype repository</name>
            <url>https://oss.sonatype.org/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

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

    <properties>
        <failIfNoTests>false</failIfNoTests>
        <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>

        <test.exclude>_</test.exclude>
        <test.exclude.pattern>_</test.exclude.pattern>

        <!-- number of threads/forks to use when running tests in parallel, see parallel-tests profile -->
        <testsThreadCount>4</testsThreadCount>

        <!-- These 2 versions are defined here because they are used -->
        <!-- JDIFF generation from embedded ant in the antrun plugin -->
        <jdiff.version>1.0.9</jdiff.version>
        <!-- Version number for xerces used by JDiff -->
        <xerces.jdiff.version>2.11.0</xerces.jdiff.version>

        <commons-daemon.version>1.0.13</commons-daemon.version>

        <test.build.dir>${project.build.directory}/test-dir</test.build.dir>
        <test.build.data>${test.build.dir}</test.build.data>

        <java.security.egd>file:///dev/urandom</java.security.egd>

        <findbugs.version>3.0.0</findbugs.version>

        <!-- define the Java language version used by the compiler -->
        <java.version>1.7</java.version>
        <javac.version>1.7</javac.version>
        <scala.major.version>2.11</scala.major.version>
        <scala.version>2.11.12</scala.version>
        <scala.macros.version>2.1.0</scala.macros.version>
        <scalatest.version>3.0.7</scalatest.version>

        <!-- platform encoding override -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- maven plugin versions -->
        <maven-deploy-plugin.version>2.8.1</maven-deploy-plugin.version>
        <maven-site-plugin.version>3.4</maven-site-plugin.version>
        <maven-antrun-plugin.version>1.7</maven-antrun-plugin.version>
        <maven-assembly-plugin.version>2.5</maven-assembly-plugin.version>
        <maven-dependency-plugin.version>2.8</maven-dependency-plugin.version>
        <maven-javadoc-plugin.version>2.10.1</maven-javadoc-plugin.version>
        <apache-rat-plugin.version>0.10</apache-rat-plugin.version>
        <wagon-ssh.version>1.0</wagon-ssh.version>
        <maven-bundle-plugin.version>2.5.0</maven-bundle-plugin.version>
        <lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
        <maven-checkstyle-plugin.version>2.15</maven-checkstyle-plugin.version>
        <checkstyle.version>6.6</checkstyle.version>
        <os-flag>linux64</os-flag>
        <dist-os-name>all</dist-os-name>


        <!-- Plugin versions and config -->
        <maven-surefire-plugin.version>2.20.1</maven-surefire-plugin.version>
        <maven-surefire-report-plugin.version>${maven-surefire-plugin.version}</maven-surefire-report-plugin.version>
        <maven-failsafe-plugin.version>${maven-surefire-plugin.version}</maven-failsafe-plugin.version>

        <junit5-maven-surefire-plugin.version>2.22.2</junit5-maven-surefire-plugin.version>
        <junit5-maven-failsafe-plugin.version>
            ${junit5-maven-surefire-plugin.version}
        </junit5-maven-failsafe-plugin.version>

        <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
        <maven-compiler-plugin.version>3.2.1</maven-compiler-plugin.version>
        <maven-install-plugin.version>2.5.1</maven-install-plugin.version>
        <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
        <maven-jar-plugin.version>2.5</maven-jar-plugin.version>
        <maven-war-plugin.version>2.4</maven-war-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-project-info-reports-plugin.version>2.7</maven-project-info-reports-plugin.version>
        <maven-pdf-plugin.version>1.2</maven-pdf-plugin.version>
        <build-helper-maven-plugin.version>1.9</build-helper-maven-plugin.version>
        <exec-maven-plugin.version>1.3.1</exec-maven-plugin.version>
        <make-maven-plugin.version>1.0-beta-1</make-maven-plugin.version>
        <native-maven-plugin.version>1.0-alpha-8</native-maven-plugin.version>
        <maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>

        <hadoop.version>3.2.4</hadoop.version>
        <guava.version>11.0.2</guava.version>
        <thrift.path>thrift</thrift.path>
        <thrift.version>0.9.2</thrift.version>
        <slf4j.version>1.7.7</slf4j.version>
        <log4j.version>2.17.1</log4j.version>
        <jackson.version>2.14.1</jackson.version>
        <jetty.version>6.1.26</jetty.version>
        <jetty.jspapi.version>6.1.14</jetty.jspapi.version>
        <commons-cli.version>1.2</commons-cli.version>
        <junit.version>4.11</junit.version>
        <junit-jupyter.version>5.9.0</junit-jupyter.version>
        <commons-codec.version>1.9</commons-codec.version>
        <commons-io.version>2.8.0</commons-io.version>
        <commons-lang.version>2.6</commons-lang.version>
        <commons-math.version>2.2</commons-math.version>
        <collections.version>3.2.1</collections.version>
        <scoverage.plugin.version>1.1.1</scoverage.plugin.version>
        <spark-version.project>2.0</spark-version.project>
        <spark.version>2.4.6</spark.version>
        <breeze.version>0.13.2</breeze.version>
        <spark-scope>provided</spark-scope>
        <bigdl.basedir>${project.basedir}</bigdl.basedir>
	    <bigdl-core-all-scope>compile</bigdl-core-all-scope>
        <data-store-url>http://download.tensorflow.org</data-store-url>
        <lightgbm.scope>provided</lightgbm.scope>
        <grpc.version>1.48.1</grpc.version>

    </properties>

    <modules>
        <module>common/spark-version</module>
        <module>dllib</module>
        <module>orca</module>
        <module>friesian</module>
        <module>grpc</module>
        <module>serving</module>
        <module>ppml</module>
        <module>assembly</module>
    </modules>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-compiler</artifactId>
                <version>${scala.version}</version>
                <scope>${spark-scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-reflect</artifactId>
                <version>${scala.version}</version>
                <scope>${spark-scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                <version>${scala.version}</version>
                <scope>${spark-scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-actors</artifactId>
                <version>${scala.version}</version>
                <scope>${spark-scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scalap</artifactId>
                <version>${scala.version}</version>
                <scope>${spark-scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest_${scala.major.version}</artifactId>
                <version>${scalatest.version}</version>
                <scope>${spark-scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-aws</artifactId>
                <version>${hadoop.version}</version>
                <scope>${spark-scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-client</artifactId>
                <version>${hadoop.version}</version>
                <scope>${spark-scope}</scope>
                <exclusions>
                    <exclusion>
                        <groupId>javax.servlet</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-common</artifactId>
                <version>${hadoop.version}</version>
                <scope>${spark-scope}</scope>
            </dependency>
            <dependency>
                <groupId>io.projectreactor</groupId>
                <artifactId>reactor-core</artifactId>
                <version>3.4.19</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-api</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-netty-shaded</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-protobuf</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-stub</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-services</artifactId>
                <version>${grpc.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven-dependency-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${maven-enforcer-plugin.version}</version>
                    <configuration>
                        <rules>
                            <requireMavenVersion>
                                <version>[3.0.2,)</version>
                            </requireMavenVersion>
                            <requireJavaVersion>
                                <version>[1.7,)</version>
                            </requireJavaVersion>
                        </rules>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.rat</groupId>
                    <artifactId>apache-rat-plugin</artifactId>
                    <version>${apache-rat-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>${maven-antrun-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven-site-plugin.version}</version>
                    <dependencies>
                        <dependency><!-- add support for ssh/scp -->
                            <groupId>org.apache.maven.wagon</groupId>
                            <artifactId>wagon-ssh</artifactId>
                            <version>${wagon-ssh.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>${maven-bundle-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.6</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>nexus</serverId>
                        <nexusUrl>http://10.239.45.219:8081/</nexusUrl>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>2.0.0</version>
                    <configuration>
                        <includeTransitiveDependencies>true</includeTransitiveDependencies>
                        <verbose>true</verbose>
                        <cleanLicensesOutputDirectory>true</cleanLicensesOutputDirectory>
                        <errorRemedy>ignore</errorRemedy>
                        <failOnMissing>false</failOnMissing>
                        <useMissingFile>true</useMissingFile>
                        <excludedGroups>^com\.intel\.</excludedGroups>
                        <includedScopes>compile</includedScopes>
                        <sortByGroupIdAndArtifactId>true</sortByGroupIdAndArtifactId>
                        <missingFile>src/license/THIRD-PARTY.properties</missingFile>
                        <licenseMerges>
                            <licenseMerge>Apache-2.0|The Apache Software License, Version 2.0</licenseMerge>
                            <licenseMerge>Apache-2.0|Apache License, Version 2.0</licenseMerge>
                            <licenseMerge>Apache-2.0|Apache Public License 2.0</licenseMerge>
                            <licenseMerge>Apache-2.0|Apache 2</licenseMerge>
                            <licenseMerge>Apache-2.0|The Apache License, Version 2.0</licenseMerge>
                            <licenseMerge>Apache-2.0|Apache License v2.0</licenseMerge>
                            <licenseMerge>Apache-2.0|Apache 2.0 License</licenseMerge>
                            <licenseMerge>Apache-2.0|Apache License</licenseMerge>
                            <licenseMerge>Apache-2.0|Apache License 2.0</licenseMerge>
                            <licenseMerge>Apache-2.0|Apache License Version 2.0</licenseMerge>
                            <licenseMerge>Apache-2.0|Apache License, version 2.0</licenseMerge>
                            <licenseMerge>MIT|The MIT License (MIT)</licenseMerge>
                            <licenseMerge>MIT|MIT License</licenseMerge>
                            <licenseMerge>MIT|The MIT License</licenseMerge>
                            <licenseMerge>BSD 2 Clause|BSD 2-Clause</licenseMerge>
                            <licenseMerge>BSD 2 Clause|BSD-2-Clause</licenseMerge>
                            <licenseMerge>BSD 2 Clause|2-Clause BSD License</licenseMerge>
                            <licenseMerge>BSD 3 Clause|BSD 3-Clause</licenseMerge>
                            <licenseMerge>BSD 3 Clause|BSD-3-Clause</licenseMerge>
                            <licenseMerge>BSD 3 Clause|3-Clause BSD License</licenseMerge>
                            <licenseMerge>BSD 3 Clause|New BSD License</licenseMerge>
                            <licenseMerge>BSD 3 Clause|BSD 3-clause</licenseMerge>
                            <licenseMerge>BSD|The BSD License</licenseMerge>
                            <licenseMerge>EDL-1.0|Eclipse Distribution License - v 1.0</licenseMerge>
                            <licenseMerge>EDL-1.0|EDL 1.0</licenseMerge>
                            <licenseMerge>JSON|The JSON License</licenseMerge>
                            <licenseMerge>Zlib-Libpng|The zlib/libpng License</licenseMerge>
                            <licenseMerge>Public Domain|Public Domain, per Creative Commons CC0</licenseMerge>
                            <licenseMerge>CPL-1.0|Common Public License Version 1.0</licenseMerge>
                            <licenseMerge>CDDL-1.0|COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0</licenseMerge>
                            <licenseMerge>CDDL-1.1|CDDL 1.1</licenseMerge>
                            <licenseMerge>LGPL-2.1|LGPL, version 2.1</licenseMerge>
                            <licenseMerge>LGPL-2.1|GNU Lesser General Public License (LGPL), Version 2.1</licenseMerge>
                            <licenseMerge>LGPL-2.1|LGPL 2.1</licenseMerge>
                        </licenseMerges>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.glassfish.copyright</groupId>
                    <artifactId>glassfish-copyright-maven-plugin</artifactId>
                    <configuration>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <id>clean</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <phase>pre-clean</phase>
                    </execution>
                    <execution>
                        <id>default</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                    <execution>
                        <id>site</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <phase>pre-site</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>python</id>
                        <inherited>false</inherited>
                        <configuration>
                            <finalName>bigdl-spark_${spark.version}-${version}</finalName>
                            <descriptors>
                                <descriptor>${project.basedir}/../python/python-zip.xml
                                </descriptor>
                            </descriptors>
                        </configuration>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.rat</groupId>
                <artifactId>apache-rat-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>.gitattributes</exclude>
                        <exclude>.gitignore</exclude>
                        <exclude>.git/**</exclude>
                        <exclude>.idea/**</exclude>
                        <exclude>**/build/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-site-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-descriptor</id>
                        <goals>
                            <goal>attach-descriptor</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <inherited>true</inherited>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin.version}</version>
            </plugin>
            <plugin><!-- for scoverage-->
                <groupId>org.scoverage</groupId>
                <artifactId>scoverage-maven-plugin</artifactId>
                <version>${scoverage.plugin.version}</version>
                <configuration>
                    <highlighting>true</highlighting>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>3.4.2</version>
                <executions>
                    <execution>
                        <id>eclipse-add-source</id>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                    </execution>
                    <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>verify</phase>
                        <goals>
                            <goal>doc-jar</goal>
                        </goals>
                        <configuration>
                            <args>
                                <!-- Do not change the arg orders. It is a weird way to pass in
                                this arg. Maybe it is a bug of the plugin. -->
                                <arg>-skip-packages</arg>
                                <arg>caffe:org.tensorflow:netty:org.apache.spark.sparkExtension:org.apache.spark.rdd:org.apache.spark.storage:org.apache.spark.bigdl</arg>
                            </args>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <scalaVersion>${scala.version}</scalaVersion>
                    <recompileMode>incremental</recompileMode>
                    <useZincServer>false</useZincServer>
                    <args>
                        <arg>-unchecked</arg>
                        <!-- Too many deprecation usage, let's suspend it temporary-->
                        <!-- arg>-deprecation</arg-->
                        <arg>-feature</arg>
                        <!-- Not enable the fatal warnings for spark 1.6-->
                        <!-- arg>-Xfatal-warnings</arg -->
                    </args>
                    <!-- The following plugin is required to use quasiquotes in Scala 2.10 and is used
                         by Spark SQL for code generation. -->
                    <compilerPlugins>
                        <compilerPlugin>
                            <groupId>org.scalamacros</groupId>
                            <artifactId>paradise_${scala.version}</artifactId>
                            <version>${scala.macros.version}</version>
                        </compilerPlugin>
                    </compilerPlugins>
                </configuration>
            </plugin>
            <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://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>properties-maven-plugin</artifactId>
                <version>1.0.0</version>
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>write-project-properties</goal>
                        </goals>
                        <configuration>
                            <outputFile>
                                ${project.build.outputDirectory}/app.properties
                            </outputFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.scalastyle</groupId>
                <artifactId>scalastyle-maven-plugin</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <verbose>false</verbose>
                    <failOnViolation>true</failOnViolation>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                    <failOnWarning>false</failOnWarning>
                    <sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
                    <testSourceDirectory>${basedir}/src/test/scala</testSourceDirectory>
                    <configLocation>${bigdl.basedir}/scalastyle_config.xml</configLocation>
                    <outputFile>${project.build.directory}/stylecheck/scalastyle-output.xml</outputFile>
                    <inputEncoding>UTF-8</inputEncoding>
                    <outputEncoding>UTF-8</outputEncoding>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <excludeDefaults>true</excludeDefaults>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>3.4.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${maven-dependency-plugin.version}</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>analyze-report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin><!-- for scoverage -->
                <groupId>org.scoverage</groupId>
                <artifactId>scoverage-maven-plugin</artifactId>
                <version>${scoverage.plugin.version}</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>report</report>
                            <!-- or <report>integration-report</report> -->
                            <!-- or <report>report-only</report> -->
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <!-- no-op profile for backwards-compatibility with build scripts, for now -->
        <profile>
            <id>spark_1.6</id>
        </profile>
        <profile>
            <id>spark_2.x</id>
            <properties>
                <java.version>1.8</java.version>
                <javac.version>1.8</javac.version>
                <spark-version.project>2.0</spark-version.project>
                <spark.version>2.4.6</spark.version>
                <scala.major.version>2.11</scala.major.version>
                <scala.version>2.11.8</scala.version>
                <scala.macros.version>2.1.0</scala.macros.version>
            </properties>
            <build>
                <plugins>
                    <!-- Redefine the plugin to enable fatal warninings -->
                    <plugin>
                        <groupId>net.alchim31.maven</groupId>
                        <artifactId>scala-maven-plugin</artifactId>
                        <version>3.4.2</version>
                        <executions>
                            <execution>
                                <id>eclipse-add-source</id>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                            </execution>
                            <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>verify</phase>
                                <goals>
                                    <goal>doc-jar</goal>
                                </goals>
                                <configuration>
                                    <args>
                                        <!-- Do not change the arg orders. It is a weird way to pass in
                                        this arg. Maybe it is a bug of the plugin. -->
                                        <arg>-skip-packages</arg>
                                        <arg>caffe:org.tensorflow:netty:org.apache.spark.sparkExtension:org.apache.spark.rdd:org.apache.spark.storage:org.apache.spark.bigdl</arg>
                                    </args>
                                </configuration>
                            </execution>
                        </executions>
                        <configuration>
                            <scalaVersion>${scala.version}</scalaVersion>
                            <recompileMode>incremental</recompileMode>
                            <useZincServer>false</useZincServer>
                            <args>
                                <arg>-unchecked</arg>
                                <!-- Too many deprecation usage, let's suspend it temporary-->
                                <arg>-deprecation:false</arg>
                                <arg>-feature</arg>
                                <!--<arg>-Xfatal-warnings</arg>-->
                            </args>
                            <!-- The following plugin is required to use quasiquotes in Scala 2.10 and is used
                                 by Spark SQL for code generation. -->
                            <compilerPlugins>
                                <compilerPlugin>
                                    <groupId>org.scalamacros</groupId>
                                    <artifactId>paradise_${scala.version}</artifactId>
                                    <version>${scala.macros.version}</version>
                                </compilerPlugin>
                            </compilerPlugins>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>spark_3.x</id>
            <properties>
                <java.version>1.8</java.version>
                <javac.version>1.8</javac.version>
                <spark-version.project>3.0</spark-version.project>
                <spark.version>3.1.3</spark.version>
                <scala.major.version>2.12</scala.major.version>
                <scala.version>2.12.10</scala.version>
                <scala.macros.version>2.1.0</scala.macros.version>
                <lightgbm.scope>compile</lightgbm.scope>
                <maven.compiler.source>${java.version}</maven.compiler.source>
                <maven.compiler.target>${java.version}</maven.compiler.target>
            </properties>
            <build>
                <plugins>
                    <!-- Redefine the plugin to enable fatal warninings -->
                    <plugin>
                        <groupId>net.alchim31.maven</groupId>
                        <artifactId>scala-maven-plugin</artifactId>
                        <version>3.4.2</version>
                        <executions>
                            <execution>
                                <id>eclipse-add-source</id>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                            </execution>
                            <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>verify</phase>
                                <goals>
                                    <goal>doc-jar</goal>
                                </goals>
                                <configuration>
                                    <args>
                                        <!-- Do not change the arg orders. It is a weird way to pass in
                                        this arg. Maybe it is a bug of the plugin. -->
                                        <arg>-skip-packages</arg>
                                        <arg>caffe:org.tensorflow:netty:org.apache.spark.sparkExtension:org.apache.spark.rdd:org.apache.spark.storage:org.apache.spark.bigdl</arg>
                                    </args>
                                </configuration>
                            </execution>
                        </executions>
                        <configuration>
                            <scalaVersion>${scala.version}</scalaVersion>
                            <recompileMode>incremental</recompileMode>
                            <useZincServer>false</useZincServer>
                            <args>
                                <arg>-unchecked</arg>
                                <!-- Too many deprecation usage, let's suspend it temporary-->
                                <arg>-deprecation:false</arg>
                                <arg>-feature</arg>
                                <!--<arg>-Xfatal-warnings</arg>-->
                            </args>
                            <!-- The following plugin is required to use quasiquotes in Scala 2.10 and is used
                                 by Spark SQL for code generation. -->
                            <compilerPlugins>
                                <compilerPlugin>
                                    <groupId>org.scalamacros</groupId>
                                    <artifactId>paradise_${scala.version}</artifactId>
                                    <version>${scala.macros.version}</version>
                                </compilerPlugin>
                            </compilerPlugins>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>scala_2.12</id>
            <properties>
                <scala.major.version>2.12</scala.major.version>
                <scala.version>2.12.10</scala.version>
                <scala.macros.version>2.1.0</scala.macros.version>
            </properties>
        </profile>
        <profile>
            <id>scala_2.11</id>
            <properties>
                <scala.major.version>2.11</scala.major.version>
                <scala.version>2.11.12</scala.version>
                <scala.macros.version>2.1.0</scala.macros.version>
            </properties>
        </profile>
        <!-- put this profile after spark_2.x profile -->
        <profile>
            <id>scala_2.10</id>
            <properties>
                <scala.major.version>2.10</scala.major.version>
                <scala.version>2.10.7</scala.version>
                <scala.macros.version>2.1.0</scala.macros.version>
            </properties>
        </profile>
        <profile>
            <id>all-in-one</id>
            <properties>
                <spark-scope>compile</spark-scope>
            </properties>
        </profile>
        <profile>
            <id>full-build</id>
            <modules>
                <module>core</module>
            </modules>
        </profile>
        <profile>
            <id>mac</id>
            <properties>
                <os-flag>mac</os-flag>
            </properties>
        </profile>
        <profile>
            <id>rh5</id>
            <properties>
                <os-flag>rh5</os-flag>
            </properties>
        </profile>
        <profile>
            <id>win64</id>
            <properties>
                <os-flag>win64</os-flag>
            </properties>
        </profile>
        <profile>
            <id>sign</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>per_platform</id>
            <properties>
                <dist-os-name>${os-flag}</dist-os-name>
            </properties>
        </profile>
    </profiles>
</project>
