<!--
  ~ Copyright 2018 ABSA Group 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>za.co.absa.enceladus</groupId>
    <artifactId>parent</artifactId>
    <version>2.26.2</version>
    <packaging>pom</packaging>

    <name>Enceladus</name>
    <description>Enceladus is a Dynamic Conformance Engine which allows data from different formats to be standardized to parquet and conformed to group-accepted common reference.</description>
    <url>https://github.com/AbsaOSS/enceladus</url>
    <inceptionYear>2018</inceptionYear>

    <scm>
        <connection>scm:git:git://github.com/AbsaOSS/enceladus.git</connection>
        <developerConnection>scm:git:ssh://github.com:AbsaOSS/enceladus.git</developerConnection>
        <url>http://github.com/AbsaOSS/enceladus/tree/master</url>
        <tag>HEAD</tag>
    </scm>

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

    <organization>
        <name>ABSA Group Limited</name>
        <url>https://www.absa.africa</url>
    </organization>

    <developers>
        <developer>
            <id>lokm01</id>
            <name>Jan Scherbaum</name>
            <timezone>Europe/Prague</timezone>
            <url>https://github.com/lokm01</url>
        </developer>
        <developer>
            <id>GeorgiChochov</id>
            <name>Georgi Chochov</name>
            <timezone>Europe/Prague</timezone>
            <url>https://github.com/GeorgiChochov</url>
        </developer>
        <developer>
            <id>Zejnilovic</id>
            <name>Saša Zejnilović</name>
            <timezone>Europe/Prague</timezone>
            <url>https://github.com/Zejnilovic</url>
        </developer>
        <developer>
            <id>benedeki</id>
            <name>David Benedeki</name>
            <timezone>Europe/Prague</timezone>
            <url>https://github.com/benedeki</url>
        </developer>
        <developer>
            <id>DzMakatun</id>
            <name>Dzmitry Makatun</name>
            <timezone>Europe/Prague</timezone>
            <url>https://github.com/DzMakatun</url>
        </developer>
        <developer>
            <id>yruslan</id>
            <name>Ruslan Iushchenko</name>
            <timezone>Europe/Prague</timezone>
            <url>https://github.com/yruslan</url>
        </developer>
        <developer>
            <id>dk1844</id>
            <name>Daniel Kavan</name>
            <timezone>Europe/Prague</timezone>
            <url>https://github.com/dk1844</url>
        </developer>
        <developer>
            <id>AdrianOlosutean</id>
            <name>Adrian Olosutean</name>
            <timezone>Europe/Prague</timezone>
            <url>https://github.com/AdrianOlosutean</url>
        </developer>
    </developers>

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

    <repositories>
        <repository>
            <id>confluent</id>
            <url>https://packages.confluent.io/maven/</url>
            <releases>
                <updatePolicy>never</updatePolicy>
            </releases>
        </repository>
    </repositories>

    <modules>
        <module>dao</module>
        <module>data-model</module>
        <module>examples</module>
        <module>menas</module>
        <module>migrations-cli</module>
        <module>migrations</module>
        <module>plugins-api</module>
        <module>plugins-builtin</module>
        <module>spark-jobs</module>
        <module>utils</module>
    </modules>

    <properties>
        <encoding>UTF-8</encoding>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <!--plugin versions-->
        <dockerfile.maven.version>1.4.13</dockerfile.maven.version>
        <gitflow.maven.plugin.version>1.16.0</gitflow.maven.plugin.version>
        <maven.antrun.plugin.version>1.8</maven.antrun.plugin.version>
        <maven.gpg.plugin.version>1.6</maven.gpg.plugin.version>
        <maven.jar.plugin.version>3.2.0</maven.jar.plugin.version>
        <maven.rat.plugin.version>0.12</maven.rat.plugin.version>
        <maven.shade.plugin.version>3.2.1</maven.shade.plugin.version>
        <maven.source.plugin.version>3.0.1</maven.source.plugin.version>
        <maven.surefire.plugin.version>2.18.1</maven.surefire.plugin.version>
        <maven.war.plugin.version>2.2</maven.war.plugin.version>
        <scala.maven.plugin.version>4.4.0</scala.maven.plugin.version>
        <scoverage.maven.plugin.version>1.3.0</scoverage.maven.plugin.version>
        <!--dependency versions-->
        <abris.version>3.1.1</abris.version>
        <absa.commons.version>0.0.27</absa.commons.version>
        <atum.version>3.7.0</atum.version>
        <bower.chart.js.version>2.7.3</bower.chart.js.version>
        <bson.codec.jsr310.version>3.5.4</bson.codec.jsr310.version>
        <cobrix.version>2.4.2</cobrix.version>
        <diffson.version>2.0.2</diffson.version>
        <gson.version>2.8.2</gson.version>
        <guava.version>27.0.1-jre</guava.version>
        <hadoop.version>2.8.5</hadoop.version>
        <htrace.version>3.1.0-incubating</htrace.version>
        <httpclient.version>4.4.1</httpclient.version>
        <jackson.spark.datatype.version>2.10.4</jackson.spark.datatype.version>
        <jackson.spark.version>2.10.4</jackson.spark.version>
        <jackson.version>2.9.8</jackson.version>
        <jjwt.version>0.10.7</jjwt.version>
        <junit.version>4.11</junit.version>
        <kafka.spark.version>0-10</kafka.spark.version>
        <lodash.version>4.17.10</lodash.version>
        <log4j.version>2.15.0</log4j.version>
        <mockito.core.version>3.5.2</mockito.core.version>
        <mockito.scala.version>1.16.42</mockito.scala.version>
        <momentjs.version>2.22.2</momentjs.version>
        <mongo.java.driver.version>3.6.4</mongo.java.driver.version>
        <mongo.scala.driver.version>2.7.0</mongo.scala.driver.version>
        <oozie.version>4.3.0</oozie.version>
        <openui5.version>1.67.1</openui5.version>
        <parquet.version>1.10.0</parquet.version>
        <requests.version>0.1.6</requests.version>
        <scala.compat.version>2.11</scala.compat.version>
        <scala.java8.compat.version>0.9.0</scala.java8.compat.version>
        <scala.version>2.11.12</scala.version>
        <scalatest.maven.version>2.0.0</scalatest.maven.version>
        <scalatest.version>3.2.2</scalatest.version>
        <scopt.version>4.0.0</scopt.version>
        <spark.compat.version>2.4</spark.compat.version>
        <spark.hats.version>0.2.2</spark.hats.version>
        <spark.hofs.version>0.4.0</spark.hofs.version>
        <spark.version>2.4.4</spark.version>
        <spark.xml.version>0.5.0</spark.xml.version>
        <specs.version>2.4.16</specs.version>
        <spline.version>0.3.9</spline.version>
        <spray.json.version>1.3.5</spray.json.version>
        <spring.kerberos.version>1.0.1.RELEASE</spring.kerberos.version>
        <spring.ldap.version>5.0.14.RELEASE</spring.ldap.version>
        <spring.version>2.0.0.RELEASE</spring.version>
        <typesafe.config.version>1.3.1</typesafe.config.version>
        <ujson.version>0.7.1</ujson.version>
        <webjars.locator.version>0.35</webjars.locator.version>
        <wiremock.version>2.26.3</wiremock.version>
        <!--other properties-->
        <quiet.scalastyle.check>true</quiet.scalastyle.check>
        <scalastyle.configLocation>${project.basedir}/scalastyle-config.xml</scalastyle.configLocation>
        <dockerfile.repository>docker.io/absaoss/menas</dockerfile.repository>
        <dockerfile.tag>${project.version}</dockerfile.tag>
        <!-- Name of property file that will be used by the Docker image. -->
        <dockerfile.property.file>docker</dockerfile.property.file>
        <skip.integration.tests>true</skip.integration.tests>
        <!-- logging-->
        <log.level.base>WARN</log.level.base>
        <log.level.testcode>ERROR</log.level.testcode>
        <log.pattern>[%p] %d{yy/MM/dd HH:mm:ss} %c{4}: %m%n</log.pattern>
        <log.specialfilters.acceptonmatch>false</log.specialfilters.acceptonmatch>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-client</artifactId>
            <version>${hadoop.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>commons-httpclient</groupId>
                    <artifactId>commons-httpclient</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-aws</artifactId>
            <version>${hadoop.version}</version>
            <scope>provided</scope>
            <exclusions>
                <!-- using AWS SDK v2 instead of v1 if desired -->
                <exclusion>
                    <groupId>com.amazonaws</groupId>
                    <artifactId>aws-java-sdk-s3</artifactId>
                </exclusion>
                <!-- contains older version than supplied otherwise -->
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_${scala.compat.version}</artifactId>
            <version>${spark.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>commons-httpclient</groupId>
                    <artifactId>commons-httpclient</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-sql_${scala.compat.version}</artifactId>
            <version>${spark.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>commons-httpclient</groupId>
                    <artifactId>commons-httpclient</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.parquet</groupId>
            <artifactId>parquet-hadoop</artifactId>
            <version>${parquet.version}</version>
        </dependency>
        <dependency>
            <groupId>za.co.absa</groupId>
            <artifactId>spark-hofs_${scala.compat.version}</artifactId>
            <version>${spark.hofs.version}</version>
        </dependency>
        <dependency>
            <groupId>za.co.absa</groupId>
            <artifactId>spark-hats_${scala.compat.version}</artifactId>
            <version>${spark.hats.version}</version>
        </dependency>
        <!-- Test -->
        <dependency>
            <groupId>org.specs2</groupId>
            <artifactId>specs2-core_${scala.compat.version}</artifactId>
            <version>${specs.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_${scala.compat.version}</artifactId>
            <version>${scalatest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-scala_${scala.compat.version}</artifactId>
            <version>${mockito.scala.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-scala-scalatest_${scala.compat.version}</artifactId>
            <version>${mockito.scala.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.core.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>src/main/scala</sourceDirectory>
        <testSourceDirectory>src/test/scala</testSourceDirectory>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.scalastyle</groupId>
                    <artifactId>scalastyle-maven-plugin</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <quiet>${quiet.scalastyle.check}</quiet>
                        <verbose>false</verbose>
                        <failOnViolation>true</failOnViolation>
                        <failOnWarning>false</failOnWarning>
                        <includeTestSourceDirectory>false</includeTestSourceDirectory>
                        <sourceDirectory>${project.basedir}/src/main/scala</sourceDirectory>
                        <testSourceDirectory>${project.basedir}/src/test/scala</testSourceDirectory>
                        <configLocation>${scalastyle.configLocation}</configLocation>
                        <outputFile>${project.basedir}/target/scalastyle-output.xml</outputFile>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <!-- disable surefire -->
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
            <!-- enable scalatest -->
            <plugin>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest-maven-plugin</artifactId>
                <version>${scalatest.maven.version}</version>
                <configuration>
                    <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                    <junitxml>.</junitxml>
                    <filereports>WDF TestSuite.txt</filereports>
                    <!--
                        Set heap memory to 4000 MB so array conformance test and conformance
                        end to end test could run. This can be removed later when dynamic conformance
                        becomes more efficient
                    -->
                    <argLine>-Xmx4000m -Dfile.encoding=UTF-8</argLine>
                </configuration>
                <executions>
                    <execution>
                        <id>unit-tests</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <suffixes>(?&lt;!IntegrationSuite)</suffixes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>integration-tests</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <suffixes>(?&lt;=IntegrationSuite)</suffixes>
                            <skipTests>${skip.integration.tests}</skipTests>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.amashchenko.maven.plugin</groupId>
                <artifactId>gitflow-maven-plugin</artifactId>
                <version>${gitflow.maven.plugin.version}</version>
                <configuration>
                    <installProject>true</installProject>
                    <verbose>true</verbose>

                    <gitFlowConfig>
                        <productionBranch>master</productionBranch>
                        <developmentBranch>develop</developmentBranch>
                        <featureBranchPrefix>feature/</featureBranchPrefix>
                        <releaseBranchPrefix>release/v</releaseBranchPrefix>
                        <hotfixBranchPrefix>hotfix/</hotfixBranchPrefix>
                        <versionTagPrefix>v</versionTagPrefix>
                        <origin>origin</origin>
                    </gitFlowConfig>
                    <commitDevelopmentVersionAtStart>true</commitDevelopmentVersionAtStart>
                    <versionDigitToIncrement>1</versionDigitToIncrement>

                    <commitMessages>
                        <hotfixStartMessage>Update versions for hotfix v@{version}</hotfixStartMessage>
                        <hotfixFinishMessage>Update for next development version @{version}</hotfixFinishMessage>
                        <hotfixVersionUpdateMessage>Update to hotfix version @{version}</hotfixVersionUpdateMessage>

                        <releaseStartMessage>Update versions for release v@{version}</releaseStartMessage>
                        <releaseFinishMessage>Update for next development version @{version}</releaseFinishMessage>
                        <releaseVersionUpdateMessage>Update for next development version @{version}</releaseVersionUpdateMessage>
                    </commitMessages>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <delimiters>
                        <delimiter>@</delimiter>
                    </delimiters>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.scoverage</groupId>
                <artifactId>scoverage-maven-plugin</artifactId>
                <version>${scoverage.maven.plugin.version}</version>
                <configuration>
                    <scalaVersion>${scala.version}</scalaVersion>
                    <aggregate>true</aggregate>
                </configuration>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
    </build>

    <profiles>
        <profile>
            <id>integration</id>
            <properties>
                <skip.integration.tests>false</skip.integration.tests>
            </properties>
        </profile>
        <profile>
            <id>scalastyle</id>
            <properties>
                <quiet.scalastyle.check>false</quiet.scalastyle.check>
            </properties>
        </profile>
        <profile>
            <id>license-check</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.rat</groupId>
                        <artifactId>apache-rat-plugin</artifactId>
                        <version>${maven.rat.plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <excludes combine.children="append">
                                <exclude>**/*.json</exclude>
                                <exclude>**/*.csv</exclude>
                                <exclude>**/*.txt</exclude>
                                <exclude>**/*.md</exclude>
                                <exclude>**/*.MF</exclude>
                                <exclude>**/*.crc</exclude>
                                <exclude>**/*.parquet</exclude>
                                <exclude>**/*.avsc</exclude>
                                <exclude>**/example*.xml</exclude>
                                <exclude>**/_SUCCESS</exclude>
                                <exclude>**/_INFO</exclude>
                                <exclude>**/CODEOWNERS</exclude>
                                <exclude>**/user.keytab*</exclude>
                                <exclude>**/json_output</exclude>
                                <exclude>**/*.iml</exclude>
                                <exclude>.editorconfig</exclude>
                                <exclude>dependency-reduced-pom.xml</exclude>
                                <exclude>scripts/cmd/tee.bat</exclude>
                                <exclude>**/org.mockito.plugins.MockMaker</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>public</id>
            <build>
                <plugins>
                    <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>
                                </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>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven.gpg.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
