How can we export the Jackson annotations in one of our bundles without the AEM communities bundles importing our version of Jackson core and Jackson databind?
As you can see in following screengrab from the OSGi console, the com.adobe.cq.social.cq-social-scf-api bundle is exporting a part of com.fasterxml.jackson.core and com.fasterxml.jackson.databind. Any package below that is not reachable.
But if we export a higher version of com.fasterxml.jackson.core.*, com.fasterxml.jackson.databind.* and com.fasterxml.jackson.annotation.* in our own bundle, the following bundles start importing our version of Jackson:
Exporting only Jackson annotations and importing Jackson core and databind from AEM itself won't help, even on the same version (different classloader and missing packages).
The reason we don't want AEM to import our version of Jackson is that we might break the AEM communities code and also because deploys take a lot longer due to the heavy OSGi bundle reloading every time we deploy our package.
There isn’t an easy way to do this on 6.1 GM – the jackson classes exported from the jackson bundles are on the system class path, so Communities picks it up as does anything else in AEM that uses Jackson. Speaking only from the Communities perspective, the customer can update to the latest 1.8 featurepack where we’ve done jackson compatibility testing, and then install whatever version of jackson they want without (too much) worry of breaking Communities. I can’t speak to other parts of AEM, though. And if they try to do this without updating to Communities FP6 and if they update to a recent Jackson, then both Communities and some DAM bundles won’t start.
Short answer: update to Communities FP6 then use whatever Jackson you like