<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.smartdatalake</groupId>
  <artifactId>spark-extensions_2.13</artifactId>
  <version>3.5.2</version>
  <name>Spark extensions</name>
  <description>Spark extensions for SmartDataLakeBuilder</description>
  <url>http://www.smartdatalake.io</url>
  <inceptionYear>2019</inceptionYear>
  <organization>
    <name>ELCA Informatique SA</name>
    <url>https://www.elca.ch</url>
  </organization>
  <licenses>
    <license>
      <name>Apache 2.0 License</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Smart Data Lake</name>
      <email>smartdatalake@elca.ch</email>
      <organization>ELCA Informatik AG</organization>
      <organizationUrl>http://www.elca.ch</organizationUrl>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:git://github.com/smart-data-lake/spark-extensions.git</connection>
    <developerConnection>scm:git:ssh://github.com/smart-data-lake/spark-extensions.git</developerConnection>
    <url>http://github.com/smart-data-lake/spark-extensions/tree/master</url>
  </scm>
  <properties>
    <skip.assembly>true</skip.assembly>
    <maven.compiler.release>8</maven.compiler.release>
    <maven.compiler.source>1.8</maven.compiler.source>
    <noLinkWarnings>-unchecked</noLinkWarnings>
    <confluent.version>7.6.0</confluent.version>
    <jackson.version>2.15.2</jackson.version>
    <maven.compiler.target>1.8</maven.compiler.target>
    <spark.version>3.5.3</spark.version>
    <scalatest.version>3.2.2</scalatest.version>
    <slf4j.version>2.0.7</slf4j.version>
    <scala.minor.version>2.13</scala.minor.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <scala.version>2.13.11</scala.version>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.fasterxml.jackson</groupId>
        <artifactId>jackson-bom</artifactId>
        <version>${jackson.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.scala-lang.modules</groupId>
      <artifactId>scala-collection-compat_2.13</artifactId>
      <version>2.11.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-core_2.13</artifactId>
      <version>${spark.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-sql_2.13</artifactId>
      <version>${spark.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-catalyst_2.13</artifactId>
      <version>${spark.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-avro_2.13</artifactId>
      <version>${spark.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>kafka-schema-registry-client</artifactId>
      <version>${confluent.version}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>org.apache.avro</groupId>
          <artifactId>avro</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-databind</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>kafka-json-schema-provider</artifactId>
      <version>${confluent.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.ws.xmlschema</groupId>
      <artifactId>xmlschema-core</artifactId>
      <version>2.2.5</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.scalatest</groupId>
      <artifactId>scalatest_2.13</artifactId>
      <version>${scalatest.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.scalatestplus</groupId>
      <artifactId>mockito-3-4_2.13</artifactId>
      <version>3.2.3.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <repositories>
    <repository>
      <id>maven central</id>
      <name>Maven Central Repository</name>
      <url>https://repo1.maven.org/maven2/</url>
    </repository>
    <repository>
      <id>confluent</id>
      <name>Confluent Schema Registry Repository</name>
      <url>https://packages.confluent.io/maven/</url>
    </repository>
  </repositories>
  <build>
    <sourceDirectory>src/main/scala</sourceDirectory>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <targetPath>META-INF</targetPath>
        <filtering>false</filtering>
        <directory>${basedir}</directory>
        <includes>
          <include>COPYING</include>
          <include>NOTICE</include>
        </includes>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
        <version>4.7.1</version>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <scalaCompatVersion>${scala.minor.version}</scalaCompatVersion>
          <checkMultipleScalaVersions>true</checkMultipleScalaVersions>
          <failOnMultipleScalaVersions>true</failOnMultipleScalaVersions>
          <recompileMode>incremental</recompileMode>
          <args>
            <arg>-unchecked</arg>
            <arg>-deprecation</arg>
            <arg>-feature</arg>
            <arg>-explaintypes</arg>
            <arg>-target:jvm-1.8</arg>
            <arg>${noLinkWarnings}</arg>
          </args>
          <jvmArgs>
            <jvmArg>-Xms64m</jvmArg>
            <jvmArg>-Xmx1024m</jvmArg>
          </jvmArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.spurint.maven.plugins</groupId>
        <artifactId>scala-cross-maven-plugin</artifactId>
        <version>0.3.0</version>
        <executions>
          <execution>
            <id>rewrite-pom</id>
            <goals>
              <goal>rewrite-pom</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.3.1</version>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>4.2</version>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin-git</artifactId>
            <version>3.0</version>
          </dependency>
        </dependencies>
        <configuration>
          <header>src/license/apachev2-header.txt</header>
          <properties>
            <copyright.name>${project.organization.name}</copyright.name>
            <copyright.contact>${project.organization.url}</copyright.contact>
          </properties>
          <includes>
            <include>src/**</include>
          </includes>
          <mapping>
            <scala>SLASHSTAR_STYLE</scala>
          </mapping>
          <failIfMissing>false</failIfMissing>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.3.0</version>
        <configuration>
          <excludes>
            <exclude>log4j.properties</exclude>
            <exclude>${project.artifactId}*.jar</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <excludes>
            <exclude>log4j.properties</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.scalatest</groupId>
        <artifactId>scalatest-maven-plugin</artifactId>
        <version>2.2.0</version>
        <executions>
          <execution>
            <goals>
              <goal>test</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <reportsDirectory>${project.build.directory}/scalatest-reports</reportsDirectory>
          <junitxml>.</junitxml>
          <filereports>${project.artifactId}.txt</filereports>
          <stdout>WT</stdout>
          <environmentVariables>
            <SPARK_LOCAL_IP>127.0.0.1</SPARK_LOCAL_IP>
          </environmentVariables>
          <argLine>--add-exports java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.nio.cs=ALL-UNNAMED --add-opens=java.base/sun.security.action=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED</argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
        <version>2.16.0</version>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>scala-2.12</id>
      <properties>
        <scala.minor.version>2.12</scala.minor.version>
        <scala.version>${scala.minor.version}.17</scala.version>
      </properties>
    </profile>
    <profile>
      <id>scala-2.13</id>
      <properties>
        <scala.minor.version>2.13</scala.minor.version>
        <scala.version>${scala.minor.version}.11</scala.version>
      </properties>
    </profile>
    <profile>
      <id>release-sonatype</id>
      <build>
        <plugins>
          <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <version>4.8.1</version>
            <executions>
              <execution>
                <id>scala-doc</id>
                <goals>
                  <goal>doc-jar</goal>
                </goals>
                <configuration>
                  <args>
                    <arg>-no-link-warnings</arg>
                  </args>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.13</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
              <stagingProgressTimeoutMinutes>30</stagingProgressTimeoutMinutes>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <repository>
          <id>ossrh</id>
          <name>Central Repository OSSRH</name>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
          <id>ossrh</id>
          <name>Central Repository OSSRH</name>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
      </distributionManagement>
    </profile>
  </profiles>
</project>
