I generated a sample project with scala3(3.5.0), zio, zio-http and zio-json. I added sbt-assembly to build a fat jar and and immediately had a duplicate error i’m not sure how to deal with.
[error] 1 error(s) were encountered during the merge:
[error] java.lang.RuntimeException:
[error] Deduplicate found different file contents in the following:
[error] Jar name = zio-json_3-0.7.1.jar, jar org = dev.zio, entry target = deriving.conf
[error] Jar name = circe-generic_3-0.14.6.jar, jar org = io.circe, entry target = deriving.conf
I’m not using circe so I’m guessing this is clashing with something internal to tapir. What’s the best way to resolve this?
For now, I’ve just done:
case PathList(ps @ _*) if ps contains "deriving.conf" =>
MergeStrategy.discard
Hi @fayi, are you sure you want both circe-generic and zio-json in your project? The conflict is not related to tapir, but it’s caused by these two JSON libs being both in your dependency path. Both libs seem to use the same file name for their derivation configurations.
The circe dependency comes from tapir-swagger-ui-bundle, as that’s what we are using to serialise the open api spec to yaml.
As for this error, you should be able to resolve it by configuring sbt-assembly to properly handle this kind of duplicate file:
ThisBuild / assemblyMergeStrategy := {
case "deriving.conf" => MergeStrategy.concat
case x =>
val oldStrategy = (ThisBuild / assemblyMergeStrategy).value
oldStrategy(x)
}