I have the following situation:
+ DentistApp
L TreatsLibrary
L IceCream 1.0
L CavityCausesLib
L IceCream 2.0
Now I get a VerifyError
because TreatsLibrary
is using IceCream.giveToKidAfterDrill()
which was removed in version 2.0 because of legal reasons.
How do I import both versions and make sure that each uses its own?
This answer assumes you're talking about how to load these libraries from a packaged uber JAR at runtime.
You need to shade your dependencies using sbt-assembly
.
This can be done as follows:
assemblyShadeRules in assembly ++= Seq(
ShadeRule.rename("IceCream.**" -> "my_icecream.@1")
.inLibrary("com.library.treats" % "TreatsLibrary" % "1.0.0")
.inProject
)
This will shade the IceCream
dependency in your com.library.treats
and change every package name to begin with my_icecream
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With