Addon with /lib folder openHAB 3.0

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 library (maven repository). As the gateway, which the addon is connected to, is not following official websocket protocol, the 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.

Any tips how to fix / proceed?

1 Like

/lib is not supported anymore. The library needs to be in an online repository and resolvable from jcenter.

Probably something to mention in the wiki page describing the breaking changes.

Are there any guides on how to make libraries resolvable from jcenter?

No. This is only relevant for developers, not users.

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.

Is it for you own development or do you want create a pull request to have it included in the openhab-addons repoaitory?

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 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).

Rewording to: For inclusion in the official repo we require all bundles to be available online.

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.


Appreciate the guidance.

Managed successful mvn install:install-file resulting in a Build Success from my openhab-addons root, e.g.

mvn install:install-file -Dfile=/Users/Kjoglum/Documents/Eclipse/openhab-master/git/openhab-addons/bundles/org.openhab.binding.freeathome/lib/xmpp-websocket-client-0.8.1-SNAPSHOT.jar -DgroupID=rocks.xmpp -DartifactID=xmpp-websocket-client-modified -Dversion=0.8.2.x -Dpackaging=jar

Included the modified version in my bundle pom.xml file:


Although, mvn build for my add-on results in:

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 (

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.

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.