<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright © 2018 Cox Automotive UK Limited

    Licensed 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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.coxautodata</groupId>
    <artifactId>waimak-parent_2.13</artifactId>
    <packaging>pom</packaging>
    <version>2.9.3</version>

    <name>Waimak</name>
    <description>Waimak is an open-source framework that makes it easier to create complex data flows in Apache Spark.
        Copyright 2018 Cox Automotive UK
        Limited; Licensed under the Apache License, Version 2.0.
    </description>
    <url>https://github.com/CoxAutomotiveDataSolutions/waimak</url>
    <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>

    <developers>
        <developer>
            <name>Alexei Perelighin</name>
            <email>alexeipab@gmail.com</email>
            <organization>Cox Automotive</organization>
            <organizationUrl>http://coxautodata.com/</organizationUrl>
        </developer>
        <developer>
            <name>Vicky Avison</name>
            <email>vicky.avison@coxauto.co.uk</email>
            <organization>Cox Automotive Data Solutions</organization>
            <organizationUrl>http://coxautodata.com/</organizationUrl>
        </developer>
        <developer>
            <name>Alex Bush</name>
            <email>alex.bush@coxauto.co.uk</email>
            <organization>Cox Automotive Data Solutions</organization>
            <organizationUrl>http://coxautodata.com/</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/CoxAutomotiveDataSolutions/waimak.git</connection>
        <developerConnection>scm:git:git://github.com/CoxAutomotiveDataSolutions/waimak.git</developerConnection>
        <url>https://github.com/CoxAutomotiveDataSolutions/waimak/tree/master</url>
    </scm>

    <modules>
        <module>waimak-core</module>
        <module>waimak-impala</module>
        <module>waimak-storage</module>
        <module>waimak-rdbm-ingestion</module>
        <module>waimak-hive</module>
        <module>waimak-experimental</module>
        <module>waimak-configuration-databricks</module>
        <module>waimak-app</module>
        <module>waimak-deequ</module>
        <module>waimak-dataquality</module>
    </modules>
    <profiles>
        <profile>
            <id>apache-3.0.3_2.12</id>
            <properties>
                <spark.version>3.0.3</spark.version>
                <scala.compatible.version>2.12</scala.compatible.version>
                <scala.lang.version>2.12.15</scala.lang.version>
                <deequ.version>1.2.2-spark-3.0</deequ.version>
            </properties>
        </profile>
        <profile>
            <id>apache-3.1.2_2.12</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <spark.version>3.1.2</spark.version>
                <scala.compatible.version>2.12</scala.compatible.version>
                <scala.lang.version>2.12.15</scala.lang.version>
                <deequ.version>2.0.0-spark-3.1</deequ.version>
            </properties>
        </profile>
        <profile>
            <id>apache-3.2.0_2.12</id>
            <properties>
                <spark.version>3.2.0</spark.version>
                <scala.compatible.version>2.12</scala.compatible.version>
                <scala.lang.version>2.12.15</scala.lang.version>
                <deequ.version>2.0.0-spark-3.1</deequ.version>
            </properties>
        </profile>
        <profile>
            <id>apache-3.2.0_2.13</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <spark.version>3.2.0</spark.version>
                <scala.compatible.version>2.13</scala.compatible.version>
                <scala.lang.version>2.13.8</scala.lang.version>
                <deequ.version>2.0.0-spark-3.1</deequ.version>
            </properties>
        </profile>
        <!-- Release profile -->
        <profile>
            <id>release</id>
            <distributionManagement>
                <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>
            <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>3.0.1</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>${maven.source.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                    <goal>test-jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.alchim31.maven</groupId>
                        <artifactId>scala-maven-plugin</artifactId>
                        <version>${scala.maven.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>doc-jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Coverage reporting -->
        <!--        <profile>-->
        <!--            <id>report</id>-->
        <!--            <build>-->
        <!--                <plugins>-->
        <!--                    <plugin>-->
        <!--                        <groupId>org.scoverage</groupId>-->
        <!--                        <artifactId>scoverage-maven-plugin</artifactId>-->
        <!--                        <version>${scoverage.plugin.version}</version>-->
        <!--                        <configuration>-->
        <!--                            <scalaVersion>${scala.lang.version}</scalaVersion>-->
        <!--                            <aggregateOnly>true</aggregateOnly>-->
        <!--                            &lt;!&ndash; other parameters &ndash;&gt;-->
        <!--                        </configuration>-->
        <!--                    </plugin>-->
        <!--                </plugins>-->
        <!--            </build>-->
        <!--        </profile>-->

    </profiles>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.sdk.version>1.8</java.sdk.version>
        <scalatest.version>3.2.10</scalatest.version>
        <azure.storage.version>6.1.0</azure.storage.version>
        <jdbc.mssql.version>8.4.1.jre8</jdbc.mssql.version>
        <jdbc.postgres.version>42.3.1</jdbc.postgres.version>
        <docker.maven.plugin.version>0.25.2</docker.maven.plugin.version>
        <scala.maven.plugin.version>4.5.6</scala.maven.plugin.version>
        <maven.compiler.plugin.version>3.9.0</maven.compiler.plugin.version>
        <scalatest.maven.plugin.version>2.0.2</scalatest.maven.plugin.version>
        <maven.jar.plugin.version>3.2.2</maven.jar.plugin.version>
        <maven.source.plugin.version>3.2.1</maven.source.plugin.version>
        <jgitflow.maven.plugin.version>1.0-m5.1</jgitflow.maven.plugin.version>
        <scoverage.plugin.version>1.4.0-RC1</scoverage.plugin.version>
        <databricks.dbutils.version>0.0.5</databricks.dbutils.version>
        <circe.version>0.14.1</circe.version>
        <mock.javamail.version>1.9</mock.javamail.version>
        <apache.commons.version>1.5</apache.commons.version>
        <sttp.version>3.3.18</sttp.version>
        <skipTests>false</skipTests>
        <skipUTs>${skipTests}</skipUTs>
        <skipITs>${skipTests}</skipITs>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_${scala.compatible.version}</artifactId>
            <version>${scalatest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.scalactic</groupId>
            <artifactId>scalactic_${scala.compatible.version}</artifactId>
            <version>${scalatest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.lang.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.scala-lang.modules</groupId>
            <artifactId>scala-collection-compat_2.13</artifactId>
            <version>2.6.0</version>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-compiler</artifactId>
            <version>${scala.lang.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_${scala.compatible.version}</artifactId>
            <version>${spark.version}</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-sql_${scala.compatible.version}</artifactId>
            <version>${spark.version}</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-sql_${scala.compatible.version}</artifactId>
            <version>${spark.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-hive_${scala.compatible.version}</artifactId>
            <version>${spark.version}</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.12.0</version>
        </dependency>
    </dependencies>
    <build>
        <sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
        <testSourceDirectory>${basedir}/src/test/scala</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>${scala.maven.plugin.version}</version>
                <configuration>
                    <args>
                        <arg>-unchecked</arg>
                        <arg>-deprecation</arg>
                        <arg>-explaintypes</arg>
                        <arg>-feature</arg>
                        <arg>-language:existentials</arg>
                    </args>
                </configuration>
                <executions>
                    <execution>
                        <id>compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <phase>compile</phase>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                        <phase>test-compile</phase>
                    </execution>
                    <execution>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven.jar.plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <source>${java.sdk.version}</source>
                    <target>${java.sdk.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>external.atlassian.jgitflow</groupId>
                <artifactId>jgitflow-maven-plugin</artifactId>
                <version>${jgitflow.maven.plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>com.jcraft</groupId>
                        <artifactId>jsch</artifactId>
                        <version>0.1.55</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <enableSshAgent>true</enableSshAgent>
                    <pushFeatures>true</pushFeatures>
                    <pushReleases>true</pushReleases>
                    <pushHotfixes>true</pushHotfixes>
                    <noDeploy>true</noDeploy>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest-maven-plugin</artifactId>
                <version>${scalatest.maven.plugin.version}</version>
                <configuration>
                    <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                    <junitxml>.</junitxml>
                    <filereports>WDF TestSuite.txt</filereports>
                    <testsFiles>*</testsFiles>
                    <argLine>-Duser.timezone=UTC</argLine>
                </configuration>
                <executions>
                    <execution>
                        <id>test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <suffixes>(?&lt;!IntegrationTest)</suffixes>
                            <skipTests>${skipUTs}</skipTests>
                        </configuration>
                    </execution>
                    <execution>
                        <id>integration-test</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <suffixes>(?&lt;=IntegrationTest)</suffixes>
                            <skipTests>${skipITs}</skipTests>
                            <reportsDirectory>${project.build.directory}/surefire-reports-integration</reportsDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
