Create the KAR file when you have delveloped your binding


I am trying to develop my own binding for some devices that I bought. Right now I have installed openhab2 via the eclipse installer method and have now two project folders:

  • OH2 Add-ons (with all the bindings inside)
  • Infrastructure (with the distro-resource and the launch projects)

Have created my binding via the cmd script in the binding folder. My problem is just now, how do I get this to a server.
I have downloaded the openhab2 files which have the start.bat script where you can run the project. I saw that you could add the openhab addons (A KAR file) in the to the addons folder to add bindings.

But how do you create that KAR file when you are developing?

Use the console , navigate to the root folder of your binding and put in
mvn clean install

If the creation goes through you will have a"target" folder in the root folder of your binding, the .kar is in there.

Super, looks like it works :wink:

Thanks alot.

Hi, i am a little bit confused now. I did the same. But got only a jar-file for my openhab1-addon and one kar-file for the whole openhab1-addons. This jar i was able to deploy in the addons directory of my existing installation. That works for me.

There might be a difference in the setup when creating OH1 and OH2 addons.