I compiled the binding in eclipse under the openhab-distro main, but when I attempt to install the binding on my 4.0.2 via the add-on folder, I get the following error. I also tried the openhab-distro 4.0.x. Any hints would be greatly appreciated.
2023-08-22 14:34:02.412 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.haywardomnilogic-4.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.haywardomnilogic 
Unresolved requirement: Import-Package: javax.measure; version="[2.2.0,3.0.0)"
Thank you. That worked. Can you explain the proper way to setup Eclipse and the distro such that it compiles for the 4.0.x version I’m running? Or better yet, can I force Maven to compile the jar for both the latest snapshot version and the last release version? Similar to this mvn switch to compile for OH3.4.0.
This is above my pay grade! Firstly I don’t use Eclipse, but more importantly, and someone might correct me here, but I don’t think you can compile for both the latest snapshot version and the last release version that easily. There are some dependencies that have changed / upgraded, like you found out with javax.measure. But there may be classes that are refactored / removed / added which can make it complicated. It’s not very often though, so simple workarounds like what I posted above is enough for me. Most of the time, it works without having to do anything special. Maybe there’s a better way, but I don’t know.
The most surefire way to do it is by applying your code to both the main branch and the 4.0.x branch and compile them separately.