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.