Update:
I'm attempting to shade dependency B, along with its transient dependency C_2.0.
I'm using the johnrengelman plugin (
https://plugins.gradle.org/plugin/com.github.johnrengelman.plugin-shadow).
I've created a Bshade.jar file this way and attached it to the project. It contains B in a renamed package B.shade.B.
I added "B.shade." to all import statements for B in my project, and "find declaration" on those import statements goes to the decompiled .class files in the jar, so it seems to be seeing it correctly.
I think B is trying to load classes through java reflection, and the shading is causing it to fail.
At least, that's what I'm gathering from the errors below:
"java.lang.reflect.InvocationTargetException: null
java.lang.NoClassDefFoundError: B/shade/B/Class1
java.lang.ClassNotFoundException: B.shade.B.Class1"
Is there a workaround for java classes loaded through reflection when shading java dependencies?