Deployment in OSGI use wrong version range for Guava dependecy

Description

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).

Environment

OSGI

Pull Requests

None

Activity

Show:
James Carman
February 17, 2015, 5:49 AM

Would you guys be interested in an OSGi integration test for your driver? I could put something together and include a PR for it.

Olivier Michallat
February 20, 2015, 6:00 PM

Yes, your contribution is welcome.

Olivier Michallat
February 20, 2015, 10:10 PM

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.

Tommy Stendahl
March 4, 2015, 8:49 AM

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.

Andy Tolbert
March 5, 2015, 5:09 AM

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:

  1. Default (default classifier with all dependencies)

  2. Netty-Shaded (shaded classifier with all depedencies w/o Netty)

  3. Guava 15 (default classifier with Guava 15.0)

  4. Guava 16

  5. Guava 17

  6. Guava 18

Fixed

Assignee

Olivier Michallat

Reporter

Tommy Stendahl

Labels

None

PM Priority

None

Reproduced in

None

Affects versions

Fix versions

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Components

Priority

Major
Configure