I am facing compilation problems due to dependency is not getting resolved between bundles.
Interface A is in Bundle A. Abstract Class B implements A in Bundle B. Added A dependency in B pom.xml. Now Class C in Bundle C extends Class B from bundle B. Hence added bundle B dependency in Bundle C pom.xml as shown in the attached image. But the issue is I still getting compilation issue in Bundle C saying it is not able to resolve Interface A which is in Bundle A.
I am not clear why is it so? Bundle C extends only Class B in Bundle B. If I add Bundle A dependency in Bundle C then it is compiled correctly without any issues.
Could you guys please let me understand about this behavior. Actually our requirement is to create a modularity between bundles hence Bundle C should not have any dependency with Bundle A. Is there any other way to achieve this without adding the Bundle A dependency in Bundle C.
The ideal way is to follow maven multi-module archetype.
If you want to proceed with your custom way, then you need to make sure the imports and exports for each bundle are tightened up. e.g. If interface A is in bundle A then only bundle A should export A and it should not be exported by either bundle B or bundle C to avoid transitive exports and ambiguities. You may need to block it explicitly in individual pom.xml of B & C.