Search code examples
aem

AEM 6.5 add Third party dependency And AEM OSGI shows 'com.twilio -- Cannot be resolved'


I want to add the dependency of twilio in AEM 6.5,there is an error such as the image This is the dependency I added so,How can AEM correctly introduce third-party dependencies?


Solution

  • You have to install the dependency as an OSGi bundle. Some libraries provide OSGi bundles as part of their releases, others you’ll have to bundle yourself. One of the ways to do this is with bnd from bndtools. They have a guide that should help you get started: https://bnd.bndtools.org/chapters/390-wrapping.html

    Once you have that, you need to ensure it declares the packages you depend on as exported and then you need to install it into your AEM. From that point on, the dependencies will be marked as resolved.