twitter / finatra

Fast, testable, Scala services built on TwitterServer and Finagle
https://twitter.github.io/finatra/
Apache License 2.0
2.27k stars 405 forks source link

Update json4s to 4.0.3 #572

Closed ggrossman closed 2 years ago

ggrossman commented 2 years ago

Problem

The latest version of json4s is 4.0.3. finatra depends on json4s 3.6.11.

Other popular libraries, such as jwt-scala, now depend on json4s 4.0.3. This creates binary compatibility problems when Finatra is used in conjunction with these libraries:

[error]     * org.json4s:json4s-core_2.12:4.0.3 (early-semver) is selected over {3.6.11, 3.6.11, 3.6.11, 3.6.7}
[error]         +- com.github.jwt-scala:jwt-json4s-common_2.12:9.0.2  (depends on 4.0.3)
[error]         +- com.twitter:util-validator_2.12:21.11.0            (depends on 3.6.7)
[error]         +- com.twitter:util-jackson_2.12:21.11.0              (depends on 3.6.11)
[error]         +- com.twitter:finatra-validation_2.12:21.11.0        (depends on 3.6.11)
[error]         +- com.twitter:finatra-jackson_2.12:21.11.0           (depends on 3.6.11)
[error] 

Solution

Finatra should bump to json4s 4.0.3. I know that all libraries in the Twitter Stack bump these dependencies at the same time, so I have also provided a PR for Twitter Util. bijection is already on json4s 4.0.3, and finagle and scrooge do not depends on json4s.

sbt test succeeds with json4s 4.0.3 and no other code changes.

I took the liberty of creating a val json4sVersion instead of having the version number separately in util-jackson and util-validator... this should help to keep them in sync in the future.

Result

Binary compatibility problems due to json4s version conflicts will cease... for now!

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

ggrossman commented 2 years ago

Note: CI is failing because twitter/util is a dependency and also must be updated to latest json4s; see https://github.com/twitter/util/pull/297