-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make JSON imports optional in OSGi environments #3971
base: master
Are you sure you want to change the base?
Conversation
When deploying in OSGi containers the Jedis bundle has two hard requirements on having the GSON and JSON bundles around. Since these depenendencies are optional we mark the imports as such in the OSGi manifest. If these packages are not exported the bundle will be installed and will be unable to make use of the JSON functionality. When they are present they will be used. Additionally, allow newer version of the org.json bundle to be used without requiring a new release of Jedis.
81d4678
to
e4d5aa4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rombert Thank you for the PR. We're checking about this change. It may take some time. In the mean time, I have a question:
I was wondering: if we are able to use the Jedis driver without these two - shouldn't we mark them as optional in the Maven dependency tree too. If we do then the |
Yes, if the Maven dependencies are marked as optional the maven-bundle-plugin should also make the imports optional. The version pinning for the org.json import, if deemed acceptable, still needs to stay. |
Yes, but this is a breaking change and has been considered as unfavorable #3278 |
Apologies, was not aware of #3278, makes sense. In this case, for OSGi specifically, this seems a reasonable improvement. AFAIK most (all?) OSGi containers depend on the user to deploy the artefacts (e.g. by using a WAR file or a nested JAR file or some other way) and the MANIFEST.MF only serves to mandate what should be loaded, so we should not have the same issues as the ones described in #3278 |
Yes, that is correct. In the current form of Jedis the two JSON bundles must be deployed, even if they are not used by the application. |
@rombert Apologies. We're still wait for a resolution from the higher-ups. FYI, making the concerned dependencies totally |
Ack, thanks @sazzad16 . Let me know if there is information/testing I can provide in the meantime. |
When deploying in OSGi containers the Jedis bundle has two hard requirements on having the GSON and JSON bundles around. Since these depenendencies are optional we mark the imports as such in the OSGi manifest.
If these packages are not exported the bundle will be installed and will be unable to make use of the JSON functionality. When they are present they will be used.
Additionally, allow newer version of the org.json bundle to be used without requiring a new release of Jedis.
Fixes #3956 .