How to create a binding for 2.5.x


I have a quick question. I want to Experiment with a new binding in my local environment (2.5.x). I don’t want to contribute something right now, I just need to build the binding based on 2.5.x.

I followed the developer guide which is very helpful. The only problem I am facing is that the build environment is based on master. I didn’t find anything in the guide about how to switch between branches. Does anyone have some guidance how to do this?

I tried to change the version in the pom.xml to something like “2.5.x” or “2.5.1” from “3.0.0-SNAPSHOT” but it doesn’t seem to work…


Perhaps parts of this tutorial are useful?

I think I figured how to do it. I just had to rebase my local openhab2-addons branch to origin/2.5.x.

Then using “2.5.1-SNAPSHOT” in my pom file seems to do what I want.

1 Like

Ok, things looked good so far, I can see in the maven dependencies that the core projects are now on 2.5.0.

Build also starts promising but in the end fails with:
Error downloading mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/2.5.1-SNAPSHOT/xml/features

It seems that karaf is not available for this version. Should I adapt this in the feature.xml? But what version to use?

Yes, adapt the feature xml, check in others bindings (on openHAB-addons repo) for how their feature.xml looks, look for ohc.version.

Thanks. Is this the feature.xml file located in “MY_BINDING/target/feature/feature.xml”?

Tried to modify this but it seems to get overwritten during build.

Btw, not sure what this feature verification would do but I already hve a jar file with my binding name even when the build fails. So I will try to use it and see if it works…

No. You have to change the file (src/main/feature/feature.xml).

See also:

Thanks for your help. Build works now without any problems

The scripts have been fixed:

1 Like