<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.acxiom</groupId>
    <artifactId>metalus</artifactId>
    <version>1.9.12</version>
    <name>${project.artifactId}</name>
    <packaging>pom</packaging>
    <description>Metalus Pipeline Library</description>
    <inceptionYear>2018</inceptionYear>

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

    <url>https://github.com/Acxiom/metalus</url>

    <scm>
        <connection>scm:git@github.com:Acxiom/metalus.git</connection>
        <url>https://github.com/Acxiom/metalus</url>
    </scm>

    <developers>
        <developer>
            <name>David Freels Sr.</name>
            <email>david.freels@acxiom.com</email>
            <organization>Acxiom</organization>
            <organizationUrl>http://acxiom.com</organizationUrl>
        </developer>
        <developer>
            <name>Ed Balogh</name>
            <email>ed.balogh@acxiom.com</email>
            <organization>Acxiom</organization>
            <organizationUrl>http://acxiom.com</organizationUrl>
        </developer>
        <developer>
            <name>David Freels Jr.</name>
            <email>david.a.freels@acxiom.com</email>
            <organization>Acxiom</organization>
            <organizationUrl>http://acxiom.com</organizationUrl>
        </developer>
    </developers>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <encoding>UTF-8</encoding>
        <scala.style.config>${basedir}/scalastyle_config.xml</scala.style.config>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <sonar.core.codeCoveragePlugin>scoverage</sonar.core.codeCoveragePlugin>
        <sonar.scala.coverage.reportPaths>${project.build.directory}/scoverage.xml</sonar.scala.coverage.reportPaths>
        <sonar.scala.scalastyle.reportPaths>${basedir}/target/checkstyle-result.xml</sonar.scala.scalastyle.reportPaths>
        <sonar.exclusions>src/test/scala/**</sonar.exclusions>
        <hadoop.minicluster.version>3.3.0</hadoop.minicluster.version>
    </properties>

    <modules>
        <module>metalus-application</module>
        <module>metalus-aws</module>
        <module>metalus-core</module>
        <module>metalus-common</module>
        <module>metalus-examples</module>
        <module>metalus-gcp</module>
<!--        <module>metalus-kafka</module>-->
<!--        <module>metalus-mongo</module>-->
        <module>metalus-utils</module>
        <module>metalus-delta</module>
    </modules>

    <dependencies>
        <!-- Scala -->
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-compiler</artifactId>
            <version>${scala.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-reflect</artifactId>
            <version>${scala.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Scala Compatability -->
        <dependency>
            <groupId>org.scala-lang.modules</groupId>
            <artifactId>scala-collection-compat_${scala.compat.version}</artifactId>
            <version>2.1.6</version>
        </dependency>
        <!-- JSON Library -->
        <dependency>
            <groupId>org.json4s</groupId>
            <artifactId>json4s-native_${scala.compat.version}</artifactId>
            <version>${json4s.version}</version>
        </dependency>
        <dependency>
            <groupId>org.json4s</groupId>
            <artifactId>json4s-ext_${scala.compat.version}</artifactId>
            <version>${json4s.version}</version>
        </dependency>
        <!-- Spark Libraries -->
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_${scala.compat.version}</artifactId>
            <version>${spark.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>netty-all</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>netty</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-sql_${scala.compat.version}</artifactId>
            <version>${spark.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- SFTP -->
        <dependency>
            <groupId>com.jcraft</groupId>
            <artifactId>jsch</artifactId>
            <version>0.1.55</version>
        </dependency>
        <!-- Test -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_${scala.compat.version}</artifactId>
            <version>3.0.8</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>27.0.1-jre</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <defaultGoal>clean scoverage:report install scala:doc scalastyle:check</defaultGoal>
        <sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
        <testSourceDirectory>${basedir}/src/test/scala</testSourceDirectory>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <!-- see http://davidb.github.com/scala-maven-plugin -->
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>4.6.1</version>
                <configuration>
                    <scalaCompatVersion>${scala.compat.version}</scalaCompatVersion>
                    <scalaVersion>${scala.version}</scalaVersion>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>testCompile</goal>
                        </goals>
                        <configuration>
                            <args>
                                <arg>-dependencyfile</arg>
                                <arg>${project.build.directory}/.scala_dependencies</arg>
                            </args>
                        </configuration>
                    </execution>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>doc-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.scoverage</groupId>
                <artifactId>scoverage-maven-plugin</artifactId>
                <version>1.4.11</version>
                <configuration>
                    <scalaVersion>${scala.version}</scalaVersion>
                    <highlighting>true</highlighting>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
                <version>4.3.0</version>
                <configuration>
                    <repoToken>${repoToken}</repoToken>
                    <coberturaReports>
                        <coberturaReport>metalus-core/target/cobertura.xml</coberturaReport>
                        <coberturaReport>metalus-common/target/cobertura.xml</coberturaReport>
                        <coberturaReport>metalus-kafka/target/cobertura.xml</coberturaReport>
                    </coberturaReports>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>
                <configuration>
                    <skipTests>true</skipTests>
                    <argLine>--illegal-access=permit</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest-maven-plugin</artifactId>
                <version>2.0.0</version>
                <configuration>
                    <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                    <junitxml>.</junitxml>
                    <!-- Test output file. The "WDF" statement provides cleaner output -->
                    <filereports>WDF TestOutput.txt</filereports>
                </configuration>
                <executions>
                    <execution>
                        <id>test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </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>${scala.style.config}</configLocation>
                    <outputFile>${basedir}/target/checkstyle-result.xml</outputFile>
                    <outputEncoding>UTF-8</outputEncoding>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.scoverage</groupId>
                <artifactId>scoverage-maven-plugin</artifactId>
                <version>1.4.11</version>
                <configuration>
                    <scalaVersion>${scala.version}</scalaVersion>
                </configuration>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>release</name>
                </property>
            </activation>

            <build>
                <plugins>
                    <!-- To release to Maven central -->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</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-source-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>spark_2.4</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <scala.version>2.11.12</scala.version>
                <scala.compat.version>2.11</scala.compat.version>
                <spark.compat.version>2.4</spark.compat.version>
                <spark.version>2.4.6</spark.version>
                <json4s.version>3.5.3</json4s.version>
                <mongo.version>2.4.2</mongo.version>
                <kinesis.client.version>1.12.0</kinesis.client.version>
                <jackson.core.version>2.9.7</jackson.core.version>
                <aws-sdk-version>1.11.595</aws-sdk-version>
                <hadoop-aws-version>2.7.7</hadoop-aws-version>
                <delta-lake-version>0.6.1</delta-lake-version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.hadoop</groupId>
                    <artifactId>hadoop-minicluster</artifactId>
                    <version>3.3.0</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>spark_3.0</id>
            <properties>
                <spark.compat.version>3.0</spark.compat.version>
                <spark.version>3.0.3</spark.version>
                <json4s.version>3.6.6</json4s.version>
                <mongo.version>3.0.0</mongo.version>
                <scala.compat.version>2.12</scala.compat.version>
                <scala.version>2.12.13</scala.version>
                <jackson.core.version>2.11.1</jackson.core.version>
                <kinesis.client.version>1.12.0</kinesis.client.version>
                <aws-sdk-version>1.11.655</aws-sdk-version>
                <hadoop-aws-version>2.7.7</hadoop-aws-version>
                <delta-lake-version>0.8.0</delta-lake-version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.hadoop</groupId>
                    <artifactId>hadoop-minicluster</artifactId>
                    <version>${hadoop.minicluster.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>spark_3.1</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <spark.compat.version>3.1</spark.compat.version>
                <spark.version>3.1.3</spark.version>
                <json4s.version>3.6.6</json4s.version>
                <mongo.version>3.0.1</mongo.version>
                <scala.compat.version>2.12</scala.compat.version>
                <scala.version>2.12.13</scala.version>
                <jackson.core.version>2.11.1</jackson.core.version>
                <kinesis.client.version>1.12.0</kinesis.client.version>
                <aws-sdk-version>1.11.655</aws-sdk-version>
                <hadoop-aws-version>2.7.7</hadoop-aws-version>
                <delta-lake-version>1.0.1</delta-lake-version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.hadoop</groupId>
                    <artifactId>hadoop-minicluster</artifactId>
                    <version>${hadoop.minicluster.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.hadoop</groupId>
                    <artifactId>hadoop-hdfs-client</artifactId>
                    <version>${hadoop.minicluster.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>spark_3.2</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <spark.compat.version>3.2</spark.compat.version>
                <spark.version>3.2.1</spark.version>
                <json4s.version>3.7.0-M11</json4s.version>
                <mongo.version>3.0.2</mongo.version>
                <scala.compat.version>2.12</scala.compat.version>
                <scala.version>2.12.13</scala.version>
                <jackson.core.version>2.12.0</jackson.core.version>
                <kinesis.client.version>1.12.0</kinesis.client.version>
                <aws-sdk-version>1.11.999</aws-sdk-version>
                <hadoop-aws-version>2.7.7</hadoop-aws-version>
                <delta-lake-version>2.0.0</delta-lake-version>
                <hadoop.minicluster.version>3.3.1</hadoop.minicluster.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.json4s</groupId>
                    <artifactId>json4s-ast_${scala.compat.version}</artifactId>
                    <version>${json4s.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.hadoop</groupId>
                    <artifactId>hadoop-minicluster</artifactId>
                    <version>${hadoop.minicluster.version}</version>
                    <scope>test</scope>
                    <exclusions>
                        <exclusion>
                            <groupId>org.apache.hadoop</groupId>
                            <artifactId>hadoop-hdfs</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>org.apache.hadoop</groupId>
                            <artifactId>hadoop-hdfs-client</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>org.apache.hadoop</groupId>
                    <artifactId>hadoop-client-minicluster</artifactId>
                    <version>${hadoop.minicluster.version}</version>
                    <scope>test</scope>
                    <exclusions>
                        <exclusion>
                            <groupId>org.apache.hadoop</groupId>
                            <artifactId>hadoop-hdfs</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>org.apache.hadoop</groupId>
                            <artifactId>hadoop-hdfs-client</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>io.netty</groupId>
                    <artifactId>netty-all</artifactId>
                    <version>4.1.68.Final</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>spark_3.3</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <spark.compat.version>3.3</spark.compat.version>
                <spark.version>3.3.2</spark.version>
                <json4s.version>3.7.0-M11</json4s.version>
                <mongo.version>3.0.2</mongo.version>
                <scala.compat.version>2.12</scala.compat.version>
                <scala.version>2.12.13</scala.version>
                <jackson.core.version>2.13.3</jackson.core.version>
                <kinesis.client.version>1.12.0</kinesis.client.version>
                <aws-sdk-version>1.11.999</aws-sdk-version>
                <hadoop-aws-version>3.3.1</hadoop-aws-version>
                <delta-lake-version>2.2.0</delta-lake-version>
                <hadoop.minicluster.version>3.3.3</hadoop.minicluster.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.json4s</groupId>
                    <artifactId>json4s-ast_${scala.compat.version}</artifactId>
                    <version>${json4s.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-1.2-api</artifactId>
                    <version>2.17.2</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-api</artifactId>
                    <version>2.17.2</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-core</artifactId>
                    <version>2.17.2</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-slf4j-impl</artifactId>
                    <version>2.17.2</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.hadoop</groupId>
                    <artifactId>hadoop-minicluster</artifactId>
                    <version>${hadoop.minicluster.version}</version>
                    <scope>test</scope>
                    <exclusions>
                        <exclusion>
                            <groupId>org.apache.hadoop</groupId>
                            <artifactId>hadoop-hdfs</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>org.apache.hadoop</groupId>
                            <artifactId>hadoop-hdfs-client</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>org.apache.hadoop</groupId>
                    <artifactId>hadoop-client-minicluster</artifactId>
                    <version>${hadoop.minicluster.version}</version>
                    <scope>test</scope>
                    <exclusions>
                        <exclusion>
                            <groupId>org.apache.hadoop</groupId>
                            <artifactId>hadoop-hdfs</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>org.apache.hadoop</groupId>
                            <artifactId>hadoop-hdfs-client</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>io.netty</groupId>
                    <artifactId>netty-all</artifactId>
                    <version>4.1.68.Final</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <!-- TODO This should be removed when we figure out what is pulling in the jms libraries -->
<!--            <repositories>-->
<!--                <repository>-->
<!--                    <id>JMS Stuff</id>-->
<!--                    <url>http://builds.archive.org/maven2</url>-->
<!--                </repository>-->
<!--            </repositories>-->
        </profile>
        <profile>
            <id>scala_2.12</id>
            <properties>
                <scala.compat.version>2.12</scala.compat.version>
                <scala.version>2.12.13</scala.version>
            </properties>
        </profile>
        <profile>
            <id>scala_2.13</id>
            <properties>
                <scala.compat.version>2.13</scala.compat.version>
                <scala.version>2.13.8</scala.version>
                <kafka.version>2.4.1</kafka.version>
                <delta-lake-version>2.2.0</delta-lake-version>
            </properties>
        </profile>
    </profiles>


    <distributionManagement>
        <site>
            <id>api.wiki</id>
            <url>https://github.com/Acxiom/metalus/wiki</url>
        </site>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
</project>
