Build binding for 2.4.0, not 2.5.0-SNAPSHOT

Hello,

I am trying to implement a few bugfixes for the yeelight binding.
I don’t yet have an IDE set up. I have just modified the files using Notepad++ and then copied them over to my Raspberry to run mvn clean install.
Then the .jar is built for 2.5.0-SNAPSHOT.
However the binding doesn’t work as expected (I am running 2.4.0 stable). I now want to build the binding for 2.4.0 stable just to make sure that there are no dependency issues.

How can I change the version for that the build is done? I tried modifying pom.xml (2.5.0-SNAPSHOT to 2.4.0) in the addons folder but that causes errors when trying to build…

There were many binding changes between 2.5.0 and the latest snapshot. The latest snapshot binding works in 2.40 though.
@chris is the zwave binding developer & “keeper of the database”.

Sorry, I don’t understand you fully.
I just want to build my changed source code of the yeelight binding for 2.4.0 as I run that version on my productive system.

Ypu can run the latest snapshot binding on 2.4.0. All bindings going forward will be based off the current snapshot. There is no 2.4 fork of the binding.
2.5M2 is the current milestone on the way to a late 2.5.0 release.

This script updates 2.4 to the latest binding.

What errors do you get? You’re having a 2.5.0-SNAPSHOT version of the sources? In that case there are probably changes in the yeelight binding that are incompatible with 2.4.0. In that case you would need to revert those changes in your local sources. Building the 2.5.0-SNAPSHOT should in general still work for 2.4.0 .

Sorry, I somehow misread this as being Z-Wave. :frowning:

@Bruce_Osborne I know, and it runs in gereral. But it doesn’t behave as expected.
I am not talking about the zigbee or zwave binding, I think you missunderstood me!
@hilbrand Yes, I have the 2.5.0-SNAPSHOT version of sources. And yes, building works just fine! But the binding doesn’t work as expected. So I thought about building the addon with 2.4.0 dependencies as I thought it could be that I am running openHAB 2.4.0 and the addon is built with 2.5.0-SNAPSHOT dependencies.

I tried modifying the pom.xml but then I get the following error:

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.openhab.addons.bundles:org.openhab.binding.yeelight:[unknown-version]: Failure to find org.openhab.addons.bundles:org.openhab.addons.reactor.bundles:pom:2.4.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 6, column 11
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project org.openhab.addons.bundles:org.openhab.binding.yeelight:[unknown-version] (/home/openhabian/openhab_clone/bundles/org.openhab.binding.yeelight/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for org.openhab.addons.bundles:org.openhab.binding.yeelight:[unknown-version]: Failure to find org.openhab.addons.bundles:org.openhab.addons.reactor.bundles:pom:2.4.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 6, column 11 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

The dependencies on the 2.5.0-SNAPSHOT during build should not be a problem. Those are all runtime dependencies and the yeelight jar is just only the yeelight code. So you should just build against 2.5.0-SNAPSHOT.

If you build with 2.5.0-SNAPSHOT and deployed on 2.4.0 I expect some exceptions due to incompatibility. Do you have such errors, or doesn’t it just not work?

No, I don’t have any incompatibility, the binding also does run but it registers the devices as offline, although they are in fact online.
If the different version can’t be the cause then I will just try again finding whats the fault in the code.

This link should be the 2.4.0 release.

Haha, I am still not talking about zwave :smiley:
Also the binding itself is not the problem, because I also tried with unmodified code. So I thought it could be the dependencies during build.

Isn’t it possible to just try to build 2.4.0? So I get a jar org.openhab.binding.yeelight-2.4.0.jar and not 2.5.0-SNAPSHOT?

They did major changes to the build system between 2.5M1 & 2.5M2.
Here?

You would need to change your github repository (or repositories) to the 2.4 branch.

Sorry, I truly understand frustration from @darkcheater because we are not guru and probably not as experience as you guys. I think he is coming from is that he wants an development environment for 2.4.0 period. and how to setup IDE to use 2.4.0? This is equivalent to now we are on 3.3.x and I want to stick to 3.2.1 as I have many deployments still on 3.2.1 and am not really to go forward. Yes, git, but is there any procedure on how to do it? So far I can’t find much info on this though but just a procedure to use .sh to create a new binding. The thing is we already went through this step in older version of openhab

This is a super old thread and you might be better creating a new thread and describing your issue there as it’s a bit unclear.

I think you can probably no longer build old versions of OH 2 as the dependencies from the core migrated repositories a year or so back if I remember correctly.

Recent versions of OH3 should be ok if you just select the appropriate branch or tag in git so you are compiling the appropriate version.

However, if you expect to be able to compile the latest version of a binding against an old version of OH3, then I suspect you will be disappointed as this will likely not work due to changes in APIs. This is quite normal - the development will provide backward compatibility as much as possible, but not the other way around,

If you’re unsure how to use git, then there are loads of resources on the web regarding how to use git - just do a quick google.