| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| ~ Licensed to the Apache Software Foundation (ASF) under one or more |
| ~ contributor license agreements. See the NOTICE file distributed with |
| ~ this work for additional information regarding copyright ownership. |
| ~ The ASF licenses this file to You 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> |
| <parent> |
| <groupId>org.apache.spark</groupId> |
| <artifactId>spark-parent_2.12</artifactId> |
| <version>3.5.1</version> |
| <relativePath>../../../../pom.xml</relativePath> |
| </parent> |
| |
| <artifactId>spark-connect-client-jvm_2.12</artifactId> |
| <packaging>jar</packaging> |
| <name>Spark Project Connect Client</name> |
| <url>https://spark.apache.org/</url> |
| <properties> |
| <sbt.project.name>connect-client-jvm</sbt.project.name> |
| </properties> |
| |
| <dependencies> |
| <dependency> |
| <groupId>org.apache.spark</groupId> |
| <artifactId>spark-connect-common_${scala.binary.version}</artifactId> |
| <version>${project.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.spark</groupId> |
| <artifactId>spark-sql-api_${scala.binary.version}</artifactId> |
| <version>${project.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.spark</groupId> |
| <artifactId>spark-sketch_${scala.binary.version}</artifactId> |
| <version>${project.version}</version> |
| </dependency> |
| <!-- |
| We need to define guava and protobuf here because we need to change the scope of both from |
| provided to compile. If we don't do this we can't shade these libraries. |
| --> |
| <dependency> |
| <groupId>com.google.guava</groupId> |
| <artifactId>guava</artifactId> |
| <version>${connect.guava.version}</version> |
| <scope>compile</scope> |
| </dependency> |
| <dependency> |
| <groupId>com.google.protobuf</groupId> |
| <artifactId>protobuf-java</artifactId> |
| <scope>compile</scope> |
| </dependency> |
| <dependency> |
| <groupId>com.lihaoyi</groupId> |
| <artifactId>ammonite_${scala.version}</artifactId> |
| <version>${ammonite.version}</version> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>commons-io</groupId> |
| <artifactId>commons-io</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.commons</groupId> |
| <artifactId>commons-lang3</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.scalacheck</groupId> |
| <artifactId>scalacheck_${scala.binary.version}</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <!-- Use mima to perform the compatibility check --> |
| <dependency> |
| <groupId>com.typesafe</groupId> |
| <artifactId>mima-core_${scala.binary.version}</artifactId> |
| <version>${mima.version}</version> |
| <scope>test</scope> |
| </dependency> |
| </dependencies> |
| <build> |
| <outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory> |
| <testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory> |
| <plugins> |
| <!-- Shade all Guava / Protobuf / Netty dependencies of this build --> |
| <!-- TODO (SPARK-42449): Ensure shading rules are handled correctly in `native-image.properties` and support GraalVM --> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-shade-plugin</artifactId> |
| <configuration> |
| <shadedArtifactAttached>false</shadedArtifactAttached> |
| <promoteTransitiveDependencies>true</promoteTransitiveDependencies> |
| <artifactSet> |
| <includes> |
| <include>com.google.android:*</include> |
| <include>com.google.api.grpc:*</include> |
| <include>com.google.code.findbugs:*</include> |
| <include>com.google.code.gson:*</include> |
| <include>com.google.errorprone:*</include> |
| <include>com.google.j2objc:*</include> |
| <include>com.google.protobuf:*</include> |
| <include>com.google.flatbuffers:*</include> |
| <include>io.grpc:*</include> |
| <include>io.netty:*</include> |
| <include>io.perfmark:*</include> |
| <include>org.apache.arrow:*</include> |
| <include>org.codehaus.mojo:*</include> |
| <include>org.checkerframework:*</include> |
| <include>org.apache.spark:spark-connect-common_${scala.binary.version}</include> |
| <include>org.apache.spark:spark-sql-api_${scala.binary.version}</include> |
| </includes> |
| </artifactSet> |
| <relocations> |
| <relocation> |
| <pattern>io.grpc</pattern> |
| <shadedPattern>${spark.shade.packageName}.io.grpc</shadedPattern> |
| <includes> |
| <include>io.grpc.**</include> |
| </includes> |
| </relocation> |
| <relocation> |
| <pattern>com.google</pattern> |
| <shadedPattern>${spark.shade.packageName}.com.google</shadedPattern> |
| <excludes> |
| <!-- Guava is relocated to ${spark.shade.packageName}.guava (see the parent pom.xml) --> |
| <exclude>com.google.common.**</exclude> |
| </excludes> |
| </relocation> |
| <relocation> |
| <pattern>io.netty</pattern> |
| <shadedPattern>${spark.shade.packageName}.io.netty</shadedPattern> |
| </relocation> |
| <relocation> |
| <pattern>org.checkerframework</pattern> |
| <shadedPattern>${spark.shade.packageName}.org.checkerframework</shadedPattern> |
| </relocation> |
| <relocation> |
| <pattern>javax.annotation</pattern> |
| <shadedPattern>${spark.shade.packageName}.javax.annotation</shadedPattern> |
| </relocation> |
| <relocation> |
| <pattern>io.perfmark</pattern> |
| <shadedPattern>${spark.shade.packageName}.io.perfmark</shadedPattern> |
| </relocation> |
| <relocation> |
| <pattern>org.codehaus</pattern> |
| <shadedPattern>${spark.shade.packageName}.org.codehaus</shadedPattern> |
| </relocation> |
| <relocation> |
| <pattern>org.apache.arrow</pattern> |
| <shadedPattern>${spark.shade.packageName}.org.apache.arrow</shadedPattern> |
| </relocation> |
| <relocation> |
| <pattern>android.annotation</pattern> |
| <shadedPattern>${spark.shade.packageName}.android.annotation</shadedPattern> |
| </relocation> |
| </relocations> |
| <!--SPARK-42228: Add `ServicesResourceTransformer` to relocation class names in META-INF/services for grpc--> |
| <transformers> |
| <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> |
| </transformers> |
| </configuration> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-jar-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>prepare-test-jar</id> |
| <phase>test-compile</phase> |
| <goals> |
| <goal>test-jar</goal> |
| </goals> |
| </execution> |
| </executions> |
| </plugin> |
| <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> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </project> |