OSGI Bundle Dependency Resolution Issue due to Version numbers
Hello Everyone,
I have recently come across an issue in handling dependencies between two custom AEM Maven Projects.
Scenario:
ProjectB has a dependency on ProjectA (OSGI dependency). Lets say current version of Project A is 1.0.0 & Project B is 1.0.0.
- In this case when we build and deploy project A, maven artifact & metadata is updated in nexus to say 1.0.0 as latest for Project A.
- And while building projectB, maven dependency is resolved as 1.0.0 & after deploying to AEM if we check the system console the import package generated as part of Manifest Header is as follows:
Import-Package: <ProjectA Package>; resolution:=optional; version="[1.0, 2)"
This kind of set the version resolution range as 1.0>x<2
We are able to do multiple deployments of ProjectA bundle successfully with version ranging between 1.0>x<2, with no issues/impacts observed on ProjectB.
However, when we change the version number of ProjectA to 2.x.x & deploy it to AEM, ProjectB is impacted. This leads to NoClassDefFoundError for all the class files which has dependency with ProjectA, but in system console the ProjectB bundle status still says "Active".
Is anyone else have come across this issue? Please do share your inputs in resolving this issue.
TIA
Regards,
Lingesh Palanivelu

