Skip to content

Commit

Permalink
add more classes to fat jar that poi needs and don't shade poi classes
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning authored and nightscape committed Aug 19, 2022
1 parent f98d618 commit 2f0e410
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ inThisBuild(
)

lazy val sparkVersion = "3.2.2"
val poiVersion = "5.2.2"

val testSparkVersion = settingKey[String]("The version of Spark to test against.")

Expand All @@ -51,19 +52,24 @@ libraryDependencies ++= Seq("org.slf4j" % "slf4j-api" % "1.7.36" % "provided")

enablePlugins(ThinFatJar)
shadedDeps ++= Seq(
"org.apache.poi" % "poi" % "5.2.2",
"org.apache.poi" % "poi-ooxml" % "5.2.2",
"org.apache.poi" % "poi" % poiVersion,
"org.apache.poi" % "poi-ooxml" % poiVersion,
"org.apache.poi" % "poi-ooxml-lite" % poiVersion,
"org.apache.xmlbeans" % "xmlbeans" % "5.0.3",
"com.norbitltd" %% "spoiwo" % "2.2.1",
"com.github.pjfanning" % "excel-streaming-reader" % "4.0.1",
"com.github.pjfanning" % "poi-shared-strings" % "2.5.3",
"commons-io" % "commons-io" % "2.11.0",
"org.apache.commons" % "commons-compress" % "1.21"
"org.apache.commons" % "commons-compress" % "1.21",
"org.apache.logging.log4j" % "log4j-api" % "2.17.2",
"com.zaxxer" % "SparseBitSet" % "1.2",
"org.apache.commons" % "commons-collections4" % "4.4",
"com.github.virtuald" % "curvesapi" % "1.07",
"commons-codec" % "commons-codec" % "1.15",
"org.apache.commons" % "commons-math3" % "3.6.1"
)

shadeRenames ++= Seq(
"org.apache.poi.**" -> "shadeio.poi.@1",
"spoiwo.**" -> "shadeio.spoiwo.@1",
"com.github.pjfanning.**" -> "shadeio.pjfanning.@1",
"org.apache.commons.io.**" -> "shadeio.commons.io.@1",
"org.apache.commons.compress.**" -> "shadeio.commons.compress.@1"
)
Expand All @@ -83,7 +89,7 @@ libraryDependencies ++= Seq(
// "com.holdenkarau" %% "spark-testing-base" % s"${testSparkVersion.value}_0.7.4" % Test,
"org.scalamock" %% "scalamock" % "5.2.0" % Test
) ++ (if (scalaVersion.value.startsWith("2.12")) Seq("com.github.nightscape" %% "spark-testing-base" % "9496d55" % Test)
else Seq())
else Seq())

// Custom source layout for Spark Data Source API 2
Compile / unmanagedSourceDirectories := {
Expand Down

0 comments on commit 2f0e410

Please sign in to comment.