How to use external jar in Adobe CQ5?
Hi,
I want to use some classes from external jar in CQ5.How its possible to do.
Please suggest me a solution.
Thanks in advance
Sridhar.M
Hi,
I want to use some classes from external jar in CQ5.How its possible to do.
Please suggest me a solution.
Thanks in advance
Sridhar.M
Well there are a few things to keep in mind :-
1. The packages you need may already be exported by an existing OSGI bundle provided as part of the AEM run-time. Use the Web Console dependency finder and search for the package names you need.
2. You should be using a Maven project (ideally created from one of the available archetypes such as the multi-module archetype from the Adobe repo or CQBlueprints). That will give your project a suitable structure and from there you just need to add the dependencies that you need in the normal way. For AEM provided packages the dependency finder will provide you with the correct POM entry. For external JARs just search Maven Central, it has pretty much all that you are likely to need.
3. For packages (from third party libraries - Jars), if you need them at run-time, you need to create an OSGI bundle and deploy that to AEM. Make sure you export all of the packages that you need to bind to in your calling code. You can use the Maven bundle plug-in to create the bundle for you and ensure that the correct manifest is constructed. There are some good articles around that show you how to do this step-by-step (google is your friend), if I get a moment later I'll post a couple of links.
HTHs
Fraser.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.