MyClass.java
is a part of Project B and it produces B.jar
Project A has B as a dependency. It produces A.jar
Project A builds fine(so the dependency is resolved at compile time)
My android app opens the A.jar file and tries to load MyClass using reflection(this has to be done this way, reasons are complicated to explain here).
My problem is, I get this error in runtime:
String java.lang.ClassNotFoundException: Didn't find class "com.foo.MyClass" on path: DexPathList[[zip file "A.jar"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
PS: If I copy source code from project B into A and build A.jar the program finds it. But I want to avoid source code copying.
Is there a way to tell maven to include a class from a dependency in the resulting jar file?