I am currently preparing the Volumio2 binding to be mergable with openhab-addons. (again) So I am trying to adopt the maven/bnd build system. I am currently failing in integrating the dependencies of the binding. (Socket.io).
I´ve read around the forum and had a look at other bindings… and after a while I found org.openhab.io.openhabcloud and it´s way to integrate socket.io through pom.xml. I´ve build the openhabcloud binding and installed it into my openhab dist. and it´s also failing with the following message:
2019-06-03 12:17:49.593 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/d/dev/oh2/openhab2-base/addons/org.openhab.io.openhabcloud-2.5.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.io.openhabcloud 
Unresolved requirement: Import-Package: io.socket.client
at org.eclipse.osgi.container.Module.start(Module.java:444) ~[?:?]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [10:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [10:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [10:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [10:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [10:org.apache.felix.fileinstall:3.6.4]
2019-06-03 12:21:59.551 [INFO ] [.dashboard.internal.DashboardService] - Stopped Dashboard
Is this a current snapshot problem… or am I doing something wrong. So it´s failing for volumio2 binding and the openhabcloud binding. And the only thing in common is me so I guess it´s my fault… and I am doing something wrong.
Karaf only installs the dependencies when you install add-on features via the UI (or feature:install on the Karaf console). When you add a single JAR in the /addons dir, Karaf doesn’t have any feature information so it also doesn’t know what dependencies to install. If you use the same dependencies+versions as the openhabcloud add-on uses, it will probably work if you first install openhabcloud and then add your own binding JAR to the /addons dir.
It´s ok for me. I am just searching a way to deploy maven build extension with dependencies to openhab. I´ve just tried the hint with feature:add-repo … and I am still failing. I guess I will need a bit time to get more into karaf/bnd … and this stuff.
Wow - really? Our maven build doesn’t have the ability to build .kar files right? (so I’d have to follow something like https://karaf.apache.org/manual/latest/kar to build one). We are struggling with this exact issue over on the sony thread as well.
Thanks - that totally worked (atleast on a clean 2.5 instance). Doing the mvn karaf:kar did result in a warning message about the packaging not being correct (but it’s only a warning - so no big deal). When I dropped the kar file into the addons directory - I got a whole bunch of dependency errors in the log (about artifacts not being found) but after about 3 minutes - everything came online (must have been downloading the various features).
Yeah - i figured as much (that’s why I waited it out). Didn’t expect a progress indicator but was hoping for some info level “Resolving …” type of messages (might be in debug but I didn’t have that on at the time). Oh well - still worked…