Embedding multiple version of the same OSGI dependency
Hello !
I have an issue with some bundle who remain inactivated (let's call it BundleX) because of an unresolved package import on a specific version of Google Guava. Guava is actually present in the OSGI container, but with a version that satisfy another dependency of the project (MyBundle).
So I have:
project-content-package
-> MyBundle
-> Guava:15.0 ( I do need this version for some features)
-> BundleX
- Guava:r06 (r06 < 15.0. I don't have the control on this bundle)
When making my content package, I'd like to embed all osgi dependencies, and to solve my problem, embed the two guava versions. As we know, OSGi supports multiple versions of packages deployed at the same time.
Until now, in my AEM content package pom configuration, I had:
<plugin> <groupId>com.day.jcr.vault</groupId> <artifactId>content-package-maven-plugin</artifactId> <configuration> <embeddeds combine.children="append"> <embedded> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <target>${cq.slingUrlSuffix}</target> </embedded> ... </embeddeds> ... </configuration> ... </plugin>The version of the embedded dependency is determined by maven and of course is unique for this maven project.
So, to sum up, to solve by problem, I should:
- embed multiple versions of Guava in osgi container. The only solution I see is creating another artifical content package pom just to upload the other Guava dependency. But it's far to be optimal since I'd like my main package to contain all embedded osgi dependencies.
- override the version of the dependency of bundle2 from r06 to 15.0, so I need only Guava 15.0 in my container. Since I don't have the control on this bundle, I should override that from outside, but I have no idea if it's possible to do that.
In advance, thank you very much for your help !