I have two dependencies imported via Maven that both import a common library, but at different versions but the versions are not compatible with each other. Essentially the problem described in this post:
But unfortunately for me, the solution is not as simple as the blog post describes, because there isn't a common version of package Z
that works for both dependencies.
Skipping the poor design decisions that led to this point as I don't control any of these libraries, I'm looking to repackage one of the top-level dependencies and shade all of its dependencies so it can essentially use its own, isolated version of Z
. Is this possible to accomplish with Maven?
One solution I have considered is isolating all the classes that depend on package Y
and putting them in a separate application and shipping that as a shaded jar
which X
imports, however I'm wondering if there's a simpler way to accomplish that.