<?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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>nessie-clients</artifactId>
    <groupId>org.projectnessie</groupId>
    <version>0.9.2</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>nessie-spark-extensions</artifactId>
  <name>Nessie - Client - Spark - Extensions</name>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>tidy-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>validate-pom</id>
            <phase>generate-resources</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>scala-compile-first</id>
            <phase>compile</phase>
            <goals>
              <goal>add-source</goal>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>scala-test-compile</id>
            <phase>test-compile</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.projectnessie</groupId>
        <artifactId>nessie-apprunner-maven-plugin</artifactId>
        <version>${client.nessie.version}</version>
        <executions>
          <execution>
            <id>start</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>start</goal>
            </goals>
          </execution>
          <execution>
            <id>stop</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>stop</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.projectnessie</groupId>
            <artifactId>nessie-quarkus</artifactId>
            <version>${client.nessie.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <skip>${skipTests}</skip>
          <appArtifactId>org.projectnessie:nessie-quarkus:${client.nessie.version}</appArtifactId>
          <applicationProperties>
            <quarkus.http.test-port>0</quarkus.http.test-port>
          </applicationProperties>
          <outputProperties>
            <quarkus.http.test-port>quarkus.http.test-port</quarkus.http.test-port>
          </outputProperties>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <systemPropertyVariables>
            <quarkus.http.test-port>${quarkus.http.test-port}</quarkus.http.test-port>
          </systemPropertyVariables>
          <additionalClasspathElements>${project.build.directory}/test-sources</additionalClasspathElements>
          <failIfNoTests>true</failIfNoTests>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <filters>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>META-INF/*.SF</exclude>
                <exclude>META-INF/*.DSA</exclude>
                <exclude>META-INF/*.RSA</exclude>
                <exclude>META-INF/jandex.idx</exclude>
                <exclude>META-INF/LICENSE</exclude>
                <exclude>LICENSE</exclude>
                <exclude>META-INF/LICENSE.md</exclude>
                <exclude>META-INF/LICENSE.txt</exclude>
                <exclude>META-INF/NOTIC*</exclude>
                <exclude>META-INF/DEPENDENCIES</exclude>
              </excludes>
            </filter>
          </filters>
          <transformers>
            <transformer />
          </transformers>
          <artifactSet>
            <includes>
              <include>org.projectnessie</include>
            </includes>
          </artifactSet>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>doc-jar</goal>
                </goals>
                <configuration>
                  <scalaVersion>2.12.13</scalaVersion>
                  <additionalDependencies>
                    <dependency>
                      <groupId>org.projectnessie</groupId>
                      <artifactId>nessie-spark-extensions</artifactId>
                      <version>0.9.2</version>
                    </dependency>
                  </additionalDependencies>
                  <sendJavaToScalac>false</sendJavaToScalac>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.projectnessie</groupId>
      <artifactId>nessie-client</artifactId>
      <version>0.9.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-hive_2.12</artifactId>
      <version>3.1.2</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>avro</artifactId>
          <groupId>org.apache.avro</groupId>
        </exclusion>
        <exclusion>
          <artifactId>arrow-vector</artifactId>
          <groupId>org.apache.arrow</groupId>
        </exclusion>
        <exclusion>
          <artifactId>commons-logging</artifactId>
          <groupId>commons-logging</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.iceberg</groupId>
      <artifactId>iceberg-spark3-runtime</artifactId>
      <version>0.12.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>5.7.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
        <exclusion>
          <artifactId>opentest4j</artifactId>
          <groupId>org.opentest4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-platform-commons</artifactId>
          <groupId>org.junit.platform</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.2.5</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>logback-core</artifactId>
          <groupId>ch.qos.logback</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>log4j-over-slf4j</artifactId>
      <version>1.7.32</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.projectnessie</groupId>
      <artifactId>nessie-client-tests</artifactId>
      <version>0.9.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.20.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>
