I am writing from scratch an OSGi bundle for Eclipse smarthome and need to export a certain package. This is needed because at the moment the karaf console is showing me this error:
Unresolved requirement: Import-Package: com.pubnub.api
In the manifest file i can see i import that same package, among others. I used maven to import it, following the official documentation here.
OSGi dev support is telling me I have to "export com.pubnub. API package in order for my bundle to import it", but I do not know how to do this. It seems I should "find or make a bundle which exports the PubNub API" but this answer is confusing me.
I suppose I would need to add a line in the manifest like "export-package etc" somewhere, but I don't know in which manifest, or if this is the right way at all. I'm a beginner in the OSGi framework.
I tried searching in similar threads (like this and this) but I don't think they're helping in my case.
This is my manifest file, for clarity:
Import-Package: org.eclipse.smarthome.core.library.types, org.eclipse.smarthome.core.thing, org.eclipse.smarthome.core.thing.binding, org.eclipse.smarthome.core.types, com.google.gson;version="[2.8,3)", com.pubnub.api, com.pubnub.api.builder, com.pubnub.api.callbacks, com.pubnub.api.endpoints.pubsub, com.pubnub.api.models.consumer, com.pubnub.api.models.consumer.pubsub, com.pubnub.api.models.consumer.pubsub.message_actions, com.pubnub.api.models.consumer.pubsub.objects, org.slf4j;version="[1.7,2)"
This is my pom:
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.3-SNAPSHOT</version>
</parent>
<artifactId>org.openhab.binding.safehome_se</artifactId>
<name>openHAB Add-ons :: Bundles :: SafeHome_SE Binding</name>
<dependencies>
<dependency>
<groupId>com.pubnub</groupId>
<artifactId>pubnub-gson</artifactId>
<version>4.31.0</version>
<scope>provided</scope>
</dependency>
</dependencies>