Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

OSGi Support? #84

Closed
sakno opened this issue Nov 18, 2015 · 13 comments
Closed

OSGi Support? #84

sakno opened this issue Nov 18, 2015 · 13 comments

Comments

@sakno
Copy link

sakno commented Nov 18, 2015

Life would be easier if consul-client will support OSGi. Today I have to wrap your library into OSGi bundle using many manipulations: excluding some dependencies, adding OSGi-compliant MANIFEST.MF and many other things.

@rickfast
Copy link
Owner

I can try to get to this in the next few weeks. Pull requests welcome.

@sakno
Copy link
Author

sakno commented Nov 19, 2015

I checked your dependencies. slf4j-api, Google Guava, jax-rs, javax-annotation and Jackson are OSGi bundles. So your dependencies are full OSGi-compliant, this is a good news. But pom.xml of consul-client must be rewritten completely: all dependencies should be declared as <scope>provided</scope>. This is not suitable for non-OSGi applications (each consumer must declare your dependencies explicitly in their POM as <scope>compile</scope>). I'll think about it.

@gjesse
Copy link
Contributor

gjesse commented Nov 19, 2015

So IMO this library probably shouldn't support OSGI - it seems like the primary use case is for non-OSGI apps, so the burden should probably be on those who want it.

One option would be to publish your wrapper with dependencies/exclusions setup, with the correct manifests in a separate repo that pulls in consul-client.

Ultimately it's @rickfast's call but just wanted to drop my 2c in.

@lburgazzoli
Copy link
Contributor

I would like to hep here but first I'd like to understand why should the dependencies be declared as provided ?

@rickfast
Copy link
Owner

I don't know enough about OSGi bundles to answer this. We can't change the main generate me pom to declare dependencies in the provided scope because that will break most of the clients.

@lburgazzoli
Copy link
Contributor

I do not think is is needed, as far as I know, once you have a proper manifest you should be ready to go (unless you have some specific requirement for calss-loading etc)

@sakno
Copy link
Author

sakno commented Apr 11, 2016

maven-bundle-plugin requires provided scope for artifacts which should not be embedded into output bundle. This technique used for libraries which are not bundlized but must be shipped with bundle.

@lburgazzoli
Copy link
Contributor

This is true if you enable Embed-Dependencies, but you can configure it to include only the dependencies you need or to skip transitive ones (Embed-Transitive).

@rickfast
Copy link
Owner

I'll defer to you guys on this. My only requirement is that this work doesn't affect the default published artifact

@lburgazzoli
Copy link
Contributor

@rickfast definitively ;)

rickfast added a commit that referenced this issue Apr 20, 2016
@lburgazzoli
Copy link
Contributor

@rickfast any chance to do a new release which include this OSGi enhancement ?

@rickfast
Copy link
Owner

0.10.2 published to bintray. Central will have to be later this week

@lburgazzoli
Copy link
Contributor

@rickfast thx

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants