2 ms·
In some cases, shading can also help. That, basically, renames a classes used in a jar. It has to be done by the creator of the jar, though. https://stackoverf
by Someone 3y ago
In some cases, shading can also help. That, basically, renames a classes used in a jar. It has to be done by the creator of the jar, though.
https://stackoverflow.com/a/49811665 https://stackoverflow.com/a/49811665:
“If your uber JAR is likely to be used as a dependency in another application then there's a risk that the versions of the dependent classes in the uber JAR might clash with versions of those same dependencies in this other application. Shading helps to avoid any such issue by renaming the packages within the uber JAR”
> unless they hand out Guava types to others, of course
You still can hand out guava objects to others, as long as you hand them out as being of a standard Java interface.
That will work as long as the receiver of the type uses instanceof with a class type or reflection, so it is a bit brittle. Technically, any breakage would indicate a bug in the receiving code, but fixing it cleanly may be impossible.