We are using the java-driver in an OSGI environment, and we got a problem due to the downgrade of guava in 2.1.3.
We have an osgi container where we deploy guava version 16.0.1 and the java-driver (and other things we need), prior to 2.1.3 this was working fine since the pom file for the java-driver specify guava version 16.0.1. But from 2.1.3 the java-driver bundle does not resolve due to the osgi environment thinks that guava version 16.0.1 does fulfil the java-drivers dependency on guava 14.0.1.
OSGI checks the versions of dependences according to version ranges and if you just specify version 14.0.1 it will accept any version that is >=14.0.1 and <15.0.0, since 16.0.1 is outside that range it does not fulfil the dependency. Since the java-driver is compatible with guava 16.0.1 I think we should update the pom file so the generated Import-Package tag in the MANIFEST.MF so that the version range is >=14.0.1 and <17.0.0.
This blocks us from upgrading to the latest driver but I think it is simple to fix.
Related issue: exclude Netty packages from OSGI manifest, since they are now shaded (see this mailing list thread).
OSGI
Would you guys be interested in an OSGi integration test for your driver? I could put something together and include a PR for it.
Yes, your contribution is welcome.
FYI, I've opened pull request #281 against the 2.0 branch to cherry-pick Tommy's changes and fix another issue related to Netty shading. If you submit an integration test, it would be great if it applied to that branch rather than 2.1.
SInce this has been merged to 2.1 now I verified in my test environment that the Guava version range is now correct when deployed in OSGI. Thx for your support with this issue.
Since I wanted to get a little more comfortable with OSGi, I made a driver-example project and an Integration test to validate this. , I hope you don't mind that I went ahead and did this (I know you said you'd be interested in putting a test together), I'd appreciate any feedback (pull request) as I have not worked with OSGi professionally for quite some time.
The integration test would be pulled into the continuous integration on cassci and runs with the following configurations:
Default (default classifier with all dependencies)
Netty-Shaded (shaded classifier with all depedencies w/o Netty)
Guava 15 (default classifier with Guava 15.0)
Guava 16
Guava 17
Guava 18