<?xml version="1.0" encoding="UTF-8"?>
<!--
 SPDX-FileCopyrightText: Copyright (c) 2023-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 SPDX-License-Identifier: LicenseRef-NvidiaProprietary

 NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
 property and proprietary rights in and to this material, related
 documentation and any modifications thereto. Any use, reproduction,
 disclosure or distribution of this material and related documentation
 without an express license agreement from NVIDIA CORPORATION or
 its affiliates is strictly prohibited.
-->
<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>

    <parent>
        <groupId>com.nvidia</groupId>
        <artifactId>rapids-4-spark-private-parent_2.13</artifactId>
        <version>26.06.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <artifactId>rapids-4-spark-private_2.13</artifactId>
    <name>RAPIDS Accelerator for Apache Spark Private Plugin</name>
    <description>The RAPIDS Private plugin for Apache Spark</description>
    <version>26.06.0</version>

    <properties>
        <!-- skip by default -->
        <dyn.shim.include.buildvers.skip>true</dyn.shim.include.buildvers.skip>
        <rapids.module>core</rapids.module>
        <aws.java.sdk.version>2.23.14</aws.java.sdk.version>
        <aws.java.sdk.scope>provided</aws.java.sdk.scope>
        <rapids.compressed.artifact>false</rapids.compressed.artifact>
        <rapids.default.jar.excludePattern>**/*</rapids.default.jar.excludePattern>
        <rapids.shim.jar.phase>package</rapids.shim.jar.phase>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.nvidia</groupId>
            <artifactId>spark-rapids-jni</artifactId>
            <classifier>${spark.rapids.jni.classifier}</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_${scala.binary.version}</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.scalatestplus</groupId>
            <artifactId>mockito-4-11_${scala.binary.version}</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>default-deps</id>
            <activation>
                <!-- Active for OSS Spark and Databricks builds. EMR provides
                     these deps via rapids-4-spark-emr-bom (system-path jars
                     under /usr/lib/spark/jars), so we must not pull in the
                     OSS coordinates there. We use !env.EMR_VERSION (rather
                     than activeByDefault=true) because activeByDefault
                     profiles are silently deactivated as soon as any other
                     profile in the same POM activates (e.g. release356 from
                     -Dbuildver=356), which would silently strip these deps
                     on every build. See the matching comment in
                     spark-rapids/shim-deps/pom.xml about a future
                     !nonOssRuntime sentinel. -->
                <property>
                    <name>!env.EMR_VERSION</name>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-sql_${scala.binary.version}</artifactId>
                    <scope>provided</scope>
                </dependency>
                <!-- AWS SDK for Java v2 -->
                <dependency>
                    <groupId>software.amazon.awssdk</groupId>
                    <artifactId>aws-crt-client</artifactId>
                    <version>${aws.java.sdk.version}</version>
                    <scope>${aws.java.sdk.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>software.amazon.awssdk</groupId>
                    <artifactId>netty-nio-client</artifactId>
                    <version>${aws.java.sdk.version}</version>
                    <scope>${aws.java.sdk.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>software.amazon.awssdk</groupId>
                    <artifactId>s3</artifactId>
                    <version>${aws.java.sdk.version}</version>
                    <scope>${aws.java.sdk.scope}</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <!-- Pulls the spark-catalyst tests classifier jar (needed for V2
                 InMemoryTableCatalog used by AggPushdownRuleApplySuite) only
                 for non-Databricks builds. Databricks does not publish a
                 tests classifier for spark-catalyst, and the Databricks shim
                 of AggPushdownRuleApplySuite only exercises V1Fixture, so
                 the tests jar is unnecessary there. -->
            <id>nonDatabricks-test-deps</id>
            <activation>
                <property>
                    <name>!databricks</name>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-catalyst_${scala.binary.version}</artifactId>
                    <classifier>tests</classifier>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>release330db</id>
            <activation>
                <property>
                    <name>buildver</name>
                    <value>330db</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-core</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>release341db</id>
            <activation>
                <property>
                    <name>buildver</name>
                    <value>341db</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-core</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-sql-api_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-common-utils_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>release350db143</id>
            <activation>
                <property>
                    <name>buildver</name>
                    <value>350db143</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-core</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-sql-api_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-common-utils_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>emr</id>
            <activation>
                <!-- Activate when the EMR_VERSION environment variable is set
                     (e.g. EMR_VERSION=7.12 mvn ...). -->
                <property>
                    <name>env.EMR_VERSION</name>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.nvidia</groupId>
                    <artifactId>rapids-4-spark-emr-bom</artifactId>
                    <version>${project.version}</version>
                    <type>pom</type>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <!--
                 Note that we are using the Spark version for all of the Databricks dependencies as well.
                 The jenkins/databricks/build.sh script handles installing the jars as maven artifacts.
                 This is to make it easier and not have to change version numbers for each individual dependency
                 and deal with differences between Databricks versions
            -->
            <id>dbdeps</id>
            <activation>
                <property>
                    <name>databricks</name>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-sql_${scala.binary.version}</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-avro_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
		    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.avro</groupId>
                    <artifactId>avro-mapred</artifactId>
                    <version>${spark.version}</version>
		    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.avro</groupId>
                    <artifactId>avro</artifactId>
                    <version>${spark.version}</version>
		    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.hive</groupId>
                    <artifactId>hive-exec</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.hive</groupId>
                    <artifactId>hive-metastore-client-patched</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.hive</groupId>
                    <artifactId>hive-serde</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-hive_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-core</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-annotations</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-core_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-annotation_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-catalyst_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-network-common_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-network-shuffle_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-launcher_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-unsafe_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.json4s</groupId>
                    <artifactId>json4s-ast_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.json4s</groupId>
                    <artifactId>json4s-core_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-io</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.scala-lang</groupId>
                    <artifactId>scala-reflect</artifactId>
                    <version>${scala.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-lang3</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>com.esotericsoftware.kryo</groupId>
                    <artifactId>kryo-shaded-db</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.parquet</groupId>
                    <artifactId>parquet-hadoop</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.parquet</groupId>
                    <artifactId>parquet-common</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.parquet</groupId>
                    <artifactId>parquet-column</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.parquet</groupId>
                    <artifactId>parquet-format</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.arrow</groupId>
                    <artifactId>arrow-memory</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.arrow</groupId>
                    <artifactId>arrow-vector</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.hadoop</groupId>
                    <artifactId>hadoop-client</artifactId>
                    <version>${hadoop.client.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.orc</groupId>
                    <artifactId>orc-core</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.orc</groupId>
                    <artifactId>orc-shims</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.orc</groupId>
                    <artifactId>orc-mapreduce</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.hive</groupId>
                    <artifactId>hive-storage-api</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>com.google.protobuf</groupId>
                    <artifactId>protobuf-java</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.rocksdb</groupId>
                    <artifactId>rocksdbjni</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <!-- dbdeps disables default-deps (Maven activeByDefault rule) -->
                <dependency>
                    <groupId>software.amazon.awssdk</groupId>
                    <artifactId>aws-crt-client</artifactId>
                    <version>${aws.java.sdk.version}</version>
                    <scope>${aws.java.sdk.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>software.amazon.awssdk</groupId>
                    <artifactId>netty-nio-client</artifactId>
                    <version>${aws.java.sdk.version}</version>
                    <scope>${aws.java.sdk.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>software.amazon.awssdk</groupId>
                    <artifactId>s3</artifactId>
                    <version>${aws.java.sdk.version}</version>
                    <scope>${aws.java.sdk.scope}</scope>
                </dependency>
            </dependencies>
        </profile>

        <!-- #if scala-2.13 -->
        <profile>
            <id>release400db173</id>
            <activation>
                <property>
                    <name>buildver</name>
                    <value>400db173</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-core</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-sql-api_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-common-utils_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-common-utils-other_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-common-config_${scala.binary.version}</artifactId>
                    <version>${spark.version}</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>
        <!-- #endif scala-2.13 -->

        <profile>
            <id>with-classifier</id>
            <activation>
                <!-- Active for OSS Spark and Databricks builds. On EMR the
                     spark-sql jar is provided as a system-path dep via
                     rapids-4-spark-emr-bom, so we must not also pull it
                     from Maven Central here. See the comment on
                     default-deps above for why this is not
                     activeByDefault=true. -->
                <property>
                    <name>!env.EMR_VERSION</name>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.apache.spark</groupId>
                    <artifactId>spark-sql_${scala.binary.version}</artifactId>
                </dependency>
            </dependencies>
        </profile>

    </profiles>

    <build>
        <resources>
          <resource>
            <!-- #if scala-2.12 --><!--
            <directory>${project.basedir}/src/main/resources</directory>
            --><!-- #endif scala-2.12 -->
            <!-- #if scala-2.13 -->
            <directory>${project.basedir}/../../core/src/main/resources</directory>
            <!-- #endif scala-2.13 -->
            <filtering>true</filtering>
          </resource>
          <resource>
            <!-- Include the properties file to provide the build information. -->
            <directory>${project.build.directory}/extra-resources</directory>
            <filtering>true</filtering>
          </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-license-notice-resources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>add-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>${spark.rapids.source.basedir}</directory>
                                    <targetPath>META-INF</targetPath>
                                    <includes>
                                        <!-- The NOTICE will be taken care of by the antrun task below -->
                                        <include>LICENSE</include>
                                        <include>NOTICE</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>set-included-buidlvers</id>
                        <goals><goal>run</goal></goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <skip>${dyn.shim.include.buildvers.skip}</skip>
                            <target xmlns:ac="antlib:net.sf.antcontrib">
                                <script language="jython" src="${spark.rapids.source.basedir}/build/dyn_shim_detection.py"/>
                            </target>
                            <exportAntProperties>true</exportAntProperties>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
