Have a custom binding/addon running perfectly under openHAB 2.5.x (currently 2.5.10). The addon uses XMPP over websocket covered by the XMPP.rocks library (maven repository). As the gateway, which the addon is connected to, is not following official websocket protocol, the XMPP.rocks library has been customized, and the customized version of the library is included in the /lib folder of the addon. Maven builds are running without failure, and addon is running successfully.
I have also managed to migrate the addon for OH 3.0 (Java 11), and initially maven builds were running without failure, and the addon was running with success on âearlyâ 3.0 environment.
Although, after a rebase to the latest 3.0 version, maven builds are failing for my addon: I now get a lot of errors stating âimport class cannot be resolved to typeâ. Classes then being present in the /lib folder.
That depends. We can upload it to our own repository or the developer can add it to jcenter himself. If you install it to your local repo, you should be good while developing.
With time there is a plan to do a pull request for having the binding included in the openhab-addons repository (need quite some code refactoring first).
As of now, the binding is developed/maintained outside the official repo, but quite a few users are making use of the addon:
The official XMPP.rocks library is already available through jcenter, although a customized version of the library is required for the addon to work.
Not necessarily - you can install your library manually through install file:/home/openhabian/myxmpp-fixed.jar command. You can also wrap xmpp within your binding, probably doubling its size (hint: add it to Export-Package or Private-Package header in bnd file).
For the short term. Just compile the library and install it locally with mvn install. Give the library a unqiue new version number. Next include the library in your binding pom.xml with scope compile. This will cause the library to be packaged jnto your binding jar. This will make it work for the the time being. When you later want to make a pull request it need to be worked out how to make the library available online.
Could not resolve dependencies for project org.openhab.addons.bundles:org.openhab.binding.freeathome:jar:3.0.0-SNAPSHOT: The following artifacts could not be resolved: rocks.xmpp:xmpp-websocket-client-modified:jar:0.8.2.x, rocks.xmpp:xmpp-websocket-common-modified:jar:0.8.2.x: Could not find artifact rocks.xmpp:xmpp-websocket-client-modified:jar:0.8.2.x in openhab-release (https://openhab.jfrog.io/openhab/libs-release)
Check what is in your m2 repository. It must contain the jar and pom file matching with the library and version you want to include. If it doesnât match or is a different version maven will try to download and that is what it will report: the download failed.
You are perfectly right. Deleted the local m2 repository, and did a fresh mvn install both for my library and my bundle, and now my bundle builds with success with library dependencies from the local m2 folder.