Skip to content

Commit

Permalink
Fix incompatible jackson libs pulled by beam-sdks-java-io-google-clou…
Browse files Browse the repository at this point in the history
…d-platform (spotify#5401)
  • Loading branch information
RustedBones authored Jul 2, 2024
1 parent 7419a21 commit c4d4554
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
10 changes: 10 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ val beamVersion = "2.56.0"

// check version used by beam
// https://github.com/apache/beam/blob/v2.56.0/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
val arrowVersion = "15.0.1"
val autoServiceVersion = "1.0.1"
val autoValueVersion = "1.9"
val bigdataossVersion = "2.2.16"
Expand Down Expand Up @@ -883,6 +884,11 @@ lazy val `scio-google-cloud-platform` = project
.settings(beamRunnerSettings)
.settings(
description := "Scio add-on for Google Cloud Platform",
unusedCompileDependenciesFilter -= Seq(
// required for patching jackson version pulled by arrow
moduleFilter("org.apache.arrow", "arrow-vector"),
moduleFilter("com.fasterxml.jackson.datatype", "jackson-datatype-jsr310")
).reduce(_ | _),
libraryDependencies ++= Seq(
// compile
"com.esotericsoftware" % "kryo-shaded" % kryoVersion,
Expand Down Expand Up @@ -924,6 +930,9 @@ lazy val `scio-google-cloud-platform` = project
"org.apache.beam" % "beam-sdks-java-io-google-cloud-platform" % beamVersion excludeAll (Exclude.avro),
"org.apache.beam" % "beam-vendor-guava-32_1_2-jre" % beamVendorVersion,
"org.slf4j" % "slf4j-api" % slf4jVersion,
// patch jackson versions
"org.apache.arrow" % "arrow-vector" % arrowVersion excludeAll (Exclude.jacksons: _*),
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % jacksonVersion,
// test
"com.google.cloud" % "google-cloud-storage" % googleCloudStorageVersion % Test,
"com.spotify" %% "magnolify-cats" % magnolifyVersion % Test,
Expand Down Expand Up @@ -1788,6 +1797,7 @@ ThisBuild / dependencyOverrides ++= Seq(
"com.fasterxml.jackson.core" % "jackson-annotations" % jacksonVersion,
"com.fasterxml.jackson.core" % "jackson-core" % jacksonVersion,
"com.fasterxml.jackson.core" % "jackson-databind" % jacksonVersion,
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % jacksonVersion,
"com.fasterxml.jackson.module" %% "jackson-module-scala" % jacksonVersion,
"com.github.luben" % "zstd-jni" % zstdJniVersion,
"com.google.api" % "api-common" % googleApiCommonVersion,
Expand Down
16 changes: 11 additions & 5 deletions project/Exclude.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@ import sbt._

object Exclude {
// do not pull newer avro version
val avro = "org.apache.avro" % "avro"
val gcsio = "com.google.cloud.bigdataoss" % "gcsio"
val avro: ExclusionRule = "org.apache.avro" % "avro"
val gcsio: ExclusionRule = "com.google.cloud.bigdataoss" % "gcsio"
// do not pull newer jackson version
val jacksons: Seq[ExclusionRule] = Seq(
ExclusionRule("com.fasterxml.jackson.core"),
ExclusionRule("com.fasterxml.jackson.datatype"),
ExclusionRule("com.fasterxml.jackson.module")
)
// replaced by io.dropwizard.metrics metrics-core
val metricsCore = "com.codahale.metrics" % "metrics-core"
val metricsCore: ExclusionRule = "com.codahale.metrics" % "metrics-core"
// kafka isn't exposed in scio and pulling too many things
val beamKafka = "org.apache.beam" % "beam-sdks-java-io-kafka"
val beamKafka: ExclusionRule = "org.apache.beam" % "beam-sdks-java-io-kafka"
// logger implementation must be given by the runner lib
val loggerImplementations = Seq(
val loggerImplementations: Seq[ExclusionRule] = Seq(
"ch.qos.logback" % "logback-classic",
"ch.qos.logback" % "logback-core",
"ch.qos.reload4j" % "reload4j",
Expand Down

0 comments on commit c4d4554

Please sign in to comment.