I have recently come across some libraries which provide their jar files with their dependencies bundled with them (sometimes referred to as an uber jar, fat jar, or shaded jar thanks to Maven's Shade plugin).
The problem is that I have two libraries (A
and B
) which contain
different versions of the same class file (same.fully.qulaified.class
), and one of the libraries doesn't play nicely with the class file version in the other. I know I could play around with a custom classloader to sandbox the classes from A
and B
, but I'd rather go with a simpler, more standard solution if one exists.
Also, in general I'm surprised that these libraries are released as uber jars at all. It seems like when library providers package their dependencies in this way, this sort of problem is likely to show up.
So I have a couple questions:
1) Is it common and accepted practice for library providers to release uber jars?
2) Are there standard solutions to resolve conflicting transient dependencies (dependencies of dependencies) that show up at runtime when two of your required libraries have different versions of a class?