How to use multiple versions of a library in Scala?

后端 未结 2 1296
星月不相逢
星月不相逢 2021-01-12 23:17

I am using a library say A in Scala which is dependent on version x.11 of another library say Z.

Now, I am also using a library say B which is dependent on version

2条回答
  •  难免孤独
    2021-01-12 23:33

    In sbt, conflicts between libraries are configured using the conflict manager. By default, the latest revision is selected but this can also be overridden in you .sbt file:

    conflictManager := ConflictManager.strict
    

    If you're using sbt 0.13.6 or greater you will be warned when you have an incompatible binary version between your dependencies. In this situation, you could configure an override in your sbt file for the specific library:

    dependencyOverrides += "org.raman" % "Z" % "x.11"
    

    This will force the resolved version of Z to x.11 but not pull a direct dependency in.

提交回复
热议问题