mikebridge mikebridge - 1 year ago 133
Scala Question

Incompatible Jackson version: 2.7.1 in sbt?

I'm getting this error when running TwitterServer from sbt:

SEVERE: LoadService: failed to
instantiate 'com.twitter.finagle.stats.MetricsExporter'
for the requested service 'com.twitter.finagle.http.HttpMuxHandler'
Incompatible Jackson version: 2.7.1

The 2.7 Jackson dependency is being pulled in transitively from elsewhere (circe). I thought I could override it to 2.6.7 this way, but it seems to have no effect:

val jacksonV = "2.6.7"
val `jackson-core` = "com.fasterxml.jackson.core" % "jackson-core" % jacksonV
val `jackson-databind` = "com.fasterxml.jackson.core" % "jackson-databind" % jacksonV
val `jackson-annotations` = "com.fasterxml.jackson.core" % "jackson-annotations" % jacksonV
val `jackson-datatype-jsr310` = "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % jacksonV
dependencyOverrides += `jackson-core`
dependencyOverrides += `jackson-databind`
dependencyOverrides += `jackson-annotations`
dependencyOverrides += `jackson-datatype-jsr310`

Any idea why this doesn't override anything?

Answer Source

It looks like I need to import the library dependencies on those overrides too, even if I'm not using them directly:

libraryDependencies ++= Seq(
    // ...
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download