How to include "javax.jmdns.impl" package in Maven Build?

I am (still) doing some work on the Velux binding, in which I need to “hack” the mDNS discovery of the Velux Bridge. To do that I need to import some classes from package javax.jmdns.impl.

In Eclipse I can just import that, and it compiles OK (and it works in my JUnit tests too).

However with Maven I get the build error shown below about being unable to resolve this package. This is puzzling since I think the OH core has a built in dependency on javax.jmdns (although it seems to have been renamed as org.jmdns for whatever reason).

Now I suppose that my problem is because I want the xx.impl sub-package rather than javax.jmdns itself. Or?? But anyway my question is how to get this sub package included in the Maven build process?

[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-binding-velux; type=karaf.feature; version=3.0.0.SNAPSHOT; filter:="(&(osgi.identity=openhab-binding-velux)(type=karaf.feature)(version>=3.0.0.SNAPSHOT))" [caused by: Unable to resolve openhab-binding-velux/3.0.0.SNAPSHOT: missing requirement [openhab-binding-velux/3.0.0.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.binding.velux; type=osgi.bundle; version="[3.0.0.202011022018,3.0.0.202011022018]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.binding.velux/3.0.0.202011022018: missing requirement [org.openhab.binding.velux/3.0.0.202011022018] osgi.wiring.package; filter:="(osgi.wiring.package=javax.jmdns.impl)"]]

Technically it’s not the maven dependency. The message is related to the osgi part, which relevant at runtime. It checks if all classes are available at runtime. This is based on that each package defines what classes are ‘exported’ and which are not. Only exported classes are available at runtime. It can been seen as classes not ‘exported’ are internal classes and thus can change for whatever reason. The classes you are trying to import are not exported and thus not available at runtime. So yes you can put it on the classpath, but it won’t work at runtime. Meaning you need to ‘hack’ something different.

Sounds as though I shall have to copy the source code…

@hilbrand many thanks for your insight. I ended up writing my own class to do it.