eclipse / paho.mqtt.java

Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
2.12k stars 884 forks source link

OSGi - org.eclipse.paho.mqttv5.client does not export sub packages #857

Open davsclaus opened 3 years ago

davsclaus commented 3 years ago

Please fill out the form below before submitting, thank you!

We are having a new paho mqtt v5 camel component and for our OSGi support then we noticed that the bundle JAR only exports

Export-Package: org.eclipse.paho.mqttv5.client;version="1.2.5"

As we use the memory persistence in the persist sub package then OSGi imports fails.

missing requirement [org.apache.camel.camel-paho-mqtt5/3.8.0.SNAPSHOT] osgi.wiring.package; filter:="(osgi.wiring.package=org.eclipse.paho.mqttv5.client.persist)"]]

I wonder if you can make the bundle JAR export its sub packages - or if they are really not for end users, then mark them as private packages in the bundle JAR manifest, then its more obvious to know.

davsclaus commented 3 years ago

Here is the OSGi export for the v3 bundle JAR with version 1.2.5

Export-Package: org.eclipse.paho.client.mqttv3;version="1.2.5",org.ecl
 ipse.paho.client.mqttv3.logging;version="1.2.5",org.eclipse.paho.clie
 nt.mqttv3.persist;version="1.2.5",org.eclipse.paho.client.mqttv3.util
 ;version="1.2.5"
JurriaanHeuberger commented 2 years ago

I would also like this to be addressed. We are using the org.eclipse.paho.mqttv5.common.MqttException, which seems like a common use case.

Ideally the jar would list all the public packages. Something like this?

Export-Package: org.eclipse.paho.mqttv5.client;version="1.2.5",org.ecl
 ipse.paho.mqttv5.common;version="1.2.5",org.eclipse.paho.mqttv5.commo
 n.util;version="1.2.5",org.eclipse.paho.mqttv5.client.logging;version
 ="1.2.5",org.eclipse.paho.mqttv5.client.persist;version="1.2.5",org.e
 clipse.paho.mqttv5.client.spi;version="1.2.5",org.eclipse.paho.mqttv5
 .client.util;version="1.2.5"
AlionSSS commented 1 year ago

A temporary workaround