<?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>spark-parent_2.12</artifactId>
    <groupId>org.apache.spark</groupId>
    <version>3.4.5-SNAPSHOT</version>
    <relativePath>../../../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>spark-connect-common_2.12</artifactId>
  <name>Spark Project Connect Common</name>
  <url>https://spark.apache.org/</url>
  <build>
    <outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory>
    <testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>
    <extensions>
      <extension>
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
        <version>1.6.2</version>
      </extension>
    </extensions>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/main/scala-${scala.binary.version}</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-scala-test-sources</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/test/gen-java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>default-protoc</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.xolstice.maven.plugins</groupId>
            <artifactId>protobuf-maven-plugin</artifactId>
            <version>0.6.1</version>
            <executions>
              <execution>
                <goals>
                  <goal>compile</goal>
                  <goal>compile-custom</goal>
                  <goal>test-compile</goal>
                </goals>
                <configuration>
                  <protocArtifact>com.google.protobuf:protoc:3.21.12:exe:${os.detected.classifier}</protocArtifact>
                  <pluginId>grpc-java</pluginId>
                  <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.47.0:exe:${os.detected.classifier}</pluginArtifact>
                  <protoSourceRoot>src/main/protobuf</protoSourceRoot>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <protocArtifact>com.google.protobuf:protoc:3.21.12:exe:${os.detected.classifier}</protocArtifact>
              <pluginId>grpc-java</pluginId>
              <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.47.0:exe:${os.detected.classifier}</pluginArtifact>
              <protoSourceRoot>src/main/protobuf</protoSourceRoot>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <os.detected.release.version>22.04</os.detected.release.version>
        <os.detected.release.like.ubuntu>true</os.detected.release.like.ubuntu>
        <os.detected.release>ubuntu</os.detected.release>
        <os.detected.name>linux</os.detected.name>
        <os.detected.release.like.debian>true</os.detected.release.like.debian>
        <os.detected.classifier>linux-x86_64</os.detected.classifier>
        <os.detected.arch>x86_64</os.detected.arch>
      </properties>
    </profile>
    <profile>
      <id>user-defined-protoc</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.xolstice.maven.plugins</groupId>
            <artifactId>protobuf-maven-plugin</artifactId>
            <version>0.6.1</version>
            <executions>
              <execution>
                <goals>
                  <goal>compile</goal>
                  <goal>compile-custom</goal>
                  <goal>test-compile</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <protocExecutable>${spark.protoc.executable.path}</protocExecutable>
              <pluginId>grpc-java</pluginId>
              <pluginExecutable>${connect.plugin.executable.path}</pluginExecutable>
              <protoSourceRoot>src/main/protobuf</protoSourceRoot>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <connect.plugin.executable.path>${env.CONNECT_PLUGIN_EXEC_PATH}</connect.plugin.executable.path>
        <spark.protoc.executable.path>${env.SPARK_PROTOC_EXEC_PATH}</spark.protoc.executable.path>
      </properties>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-catalyst_2.12</artifactId>
      <version>3.4.5-SNAPSHOT</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>guava</artifactId>
          <groupId>com.google.guava</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>
      <version>2.12.17</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
      <version>3.21.12</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-netty</artifactId>
      <version>1.47.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-protobuf</artifactId>
      <version>1.47.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-services</artifactId>
      <version>1.47.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-stub</artifactId>
      <version>1.47.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-codec-http2</artifactId>
      <version>4.1.87.Final</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-handler-proxy</artifactId>
      <version>4.1.87.Final</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-transport-native-unix-common</artifactId>
      <version>4.1.87.Final</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.tomcat</groupId>
      <artifactId>annotations-api</artifactId>
      <version>6.0.53</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-tags_2.12</artifactId>
      <version>3.4.5-SNAPSHOT</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.scalatest</groupId>
      <artifactId>scalatest_2.12</artifactId>
      <version>3.2.15</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>scalatest-core_2.12</artifactId>
          <groupId>org.scalatest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scalatest-featurespec_2.12</artifactId>
          <groupId>org.scalatest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scalatest-flatspec_2.12</artifactId>
          <groupId>org.scalatest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scalatest-freespec_2.12</artifactId>
          <groupId>org.scalatest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scalatest-funsuite_2.12</artifactId>
          <groupId>org.scalatest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scalatest-funspec_2.12</artifactId>
          <groupId>org.scalatest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scalatest-propspec_2.12</artifactId>
          <groupId>org.scalatest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scalatest-refspec_2.12</artifactId>
          <groupId>org.scalatest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scalatest-wordspec_2.12</artifactId>
          <groupId>org.scalatest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scalatest-diagrams_2.12</artifactId>
          <groupId>org.scalatest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scalatest-matchers-core_2.12</artifactId>
          <groupId>org.scalatest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scalatest-shouldmatchers_2.12</artifactId>
          <groupId>org.scalatest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scalatest-mustmatchers_2.12</artifactId>
          <groupId>org.scalatest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.scalatestplus</groupId>
      <artifactId>scalacheck-1-17_2.12</artifactId>
      <version>3.2.15.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>scalacheck_2.12</artifactId>
          <groupId>org.scalacheck</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scalatest-core_2.12</artifactId>
          <groupId>org.scalatest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.scalatestplus</groupId>
      <artifactId>mockito-4-6_2.12</artifactId>
      <version>3.2.15.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>mockito-core</artifactId>
          <groupId>org.mockito</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scalatest-core_2.12</artifactId>
          <groupId>org.scalatest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.scalatestplus</groupId>
      <artifactId>selenium-4-7_2.12</artifactId>
      <version>3.2.15.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>selenium-java</artifactId>
          <groupId>org.seleniumhq.selenium</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scalatest-core_2.12</artifactId>
          <groupId>org.scalatest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.github.sbt</groupId>
      <artifactId>junit-interface</artifactId>
      <version>0.13.3</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>test-interface</artifactId>
          <groupId>org.scala-sbt</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <properties>
    <guava.failureaccess.version>1.0.1</guava.failureaccess.version>
    <tomcat.annotations.api.version>6.0.53</tomcat.annotations.api.version>
    <guava.version>31.0.1-jre</guava.version>
    <io.grpc.version>1.47.0</io.grpc.version>
    <sbt.project.name>connect-common</sbt.project.name>
  </properties>
</project>
