I have a Maven project that contains two dependencies A and B. Each of them is transitively dependent on C, but they depend on different versions of C. Let's say that A depends on C version 1, and B depends on C version 2.
Unfortunately, A is not bytecode compatible with version 2, nor B with version 1. (As it happens, A is compatible with version 2, but I don’t think it will help us here.)
This means that I need both versions of the transitive dependency in my project, and I need A to use version 1 and B to use version 2.
Is there any way to do this?
I suggested that I would need to use a shadow plugin to move the name of package A and all its dependencies, but this is not possible. If I shade A, its dependencies will not be shaded, and it still selects version 2 and does not start.
source
share