Skip to content

Commit

Permalink
[HUDI-3858] Shade javax.servlet for Spark bundle jar (#5295)
Browse files Browse the repository at this point in the history
Co-authored-by: yuezhang <yuezhang@freewheel.tv>
  • Loading branch information
zhangyue19921010 and yuezhang authored May 21, 2022
1 parent b5adba3 commit 8ec625d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packaging/hudi-spark-bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<properties>
<checkstyle.skip>true</checkstyle.skip>
<main.basedir>${project.parent.basedir}</main.basedir>
<javax.servlet.version>3.1.0</javax.servlet.version>
</properties>

<build>
Expand Down Expand Up @@ -80,6 +81,7 @@
<include>org.apache.hudi:hudi-timeline-service</include>
<include>org.apache.hudi:hudi-aws</include>

<include>javax.servlet:javax.servlet-api</include>
<include>com.beust:jcommander</include>
<include>io.javalin:javalin</include>
<!-- Spark only has mortbay jetty -->
Expand Down Expand Up @@ -138,6 +140,10 @@
<!-- NOTE: We have to relocate all classes w/in org.apache.spark.sql.avro to avoid
potential classpath collisions in case users would like to also use "spark-avro" w/in
their runtime, since Hudi carries some of the same classes as "spark-avro" -->
<relocation>
<pattern>javax.servlet.</pattern>
<shadedPattern>org.apache.hudi.javax.servlet.</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.spark.sql.avro.</pattern>
<shadedPattern>org.apache.hudi.org.apache.spark.sql.avro.</shadedPattern>
Expand Down Expand Up @@ -378,6 +384,12 @@
<artifactId>hive-service</artifactId>
<version>${hive.version}</version>
<scope>${spark.bundle.hive.scope}</scope>
<exclusions>
<exclusion>
<artifactId>servlet-api</artifactId>
<groupId>javax.servlet</groupId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down Expand Up @@ -426,6 +438,13 @@
<artifactId>curator-recipes</artifactId>
<version>${zk-curator.version}</version>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${javax.servlet.version}</version>
</dependency>

<!-- TODO: Reinvestigate PR 633 -->
</dependencies>

Expand Down

0 comments on commit 8ec625d

Please sign in to comment.