openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.58k forks source link

Bindings in addons folder don't start anymore #10686

Closed weymann closed 3 years ago

weymann commented 3 years ago

I switched from 3.0.1 stable branch to latest 3.1M4 Milestone via openhabian-config tool. I've several development bindings in addons folder and each one is reporting dependency errors now.

Installing BMWConnectedDrive binding in UI works fine. After removing in UI again and copy the binding from my development environment into addons folder a dependency is missing. This worked fine before.

2021-05-13 17:43:44.648 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.bmwconnecteddrive-3.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.bmwconnecteddrive [312]
  Unresolved requirement: Import-Package: javax.measure; version="[2.1.0,3.0.0)"

I checked also the binding fmiweather with javax.measure dependency with the same result.

Steps to reproduce

In a clean run I deleted also local stored maven repositories and cleaned the openhab-cache before restarting.

Environment

openhab 3.1M4 version with openhabian image on Raspi 4

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: C:\Apps\apache-maven-3.8.1
Java version: 11.0.9.1, vendor: AdoptOpenJDK, runtime: C:\Program Files\AdoptOpenJDK\jdk-11.0.9.101-hotspot
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
J-N-K commented 3 years ago

Not a bug. There was a breaking change with the karaf upgrade between M3 and M4 which requires re-compilation of the bindings. But take care: there was another breaking change after M4 (regarding UoM) which might make it impossible to run bindings compiled against a SNAPSHOT core on M4.

weymann commented 3 years ago

Can you give me hint / link to this breaking change and what needs to be adapted? As said - recompilation was done with a fresh cloned repo (1h ago) without any changes!

J-N-K commented 3 years ago

My fault. I didn't read everything. The UoM library was updated in openhab-code#2319. So bindings compiled against latest SNAPSHOT depend on a UoM library that is not present in M4 and therefore will not run (that's why it complains about the missing javax.measure >=2.1.0).

You either need to update your system to SNAPSHOT (due to some bugs related to that upgrade I would not recommend that at the moment) or compile your binding agains the openhab-core 3.1.0.M4. You can achieve that by editing the base pom.xml and changing ohc.version from 3.1.0-SNAPSHOT to 3.1.0.M4.

weymann commented 3 years ago

This version seems not to be available for download. Perhaps any typo in the version number?

[INFO] --< org.openhab.addons.bundles:org.openhab.binding.bmwconnecteddrive >--
[INFO] Building openHAB Add-ons :: Bundles :: BMWConnectedDrive Binding 3.1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.openhab.core.bom:org.openhab.core.bom.compile:pom:3.1.0.M4 is missing, no dependency information available
[WARNING] The POM for org.openhab.core.bom:org.openhab.core.bom.openhab-core:pom:3.1.0.M4 is missing, no dependency information available
[WARNING] The POM for org.openhab.core.bom:org.openhab.core.bom.test:pom:3.1.0.M4 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  13.315 s
[INFO] Finished at: 2021-05-13T19:41:14+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project org.openhab.binding.bmwconnecteddrive: Could not resolve dependencies for project org.openhab.addons.bundles:org.openhab.binding.bmwconnecteddrive:jar:3.1.0-SNAPSHOT: The following artifacts could not be resolved: org.openhab.core.bom:org.openhab.core.bom.compile:pom:3.1.0.M4, org.openhab.core.bom:org.openhab.core.bom.openhab-core:pom:3.1.0.M4, org.openhab.core.bom:org.openhab.core.bom.test:pom:3.1.0.M4: org.openhab.core.bom:org.openhab.core.bom.compile:pom:3.1.0.M4 was not found in https://openhab.jfrog.io/openhab/libs-release during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of openhab-release has elapsed or updates are forced -> [Help 1]
[ERROR]
JWteK commented 3 years ago

I've got the same problem trying to build a velbus binding. Spend already 2 days to find a solution, so I would be happy to get it working again.

J-N-K commented 3 years ago

Seems it's in a repo that can't be accessed. Build it locally.

After that M4 is available in your local repo and you can use 3.1.0.M4 as ohc.version. Depeneding on the machine you use, you can omit -DskipChecks -DskipTests (there is an unfixed bug in a test that prevents building core on windows machines). You absolutely have to use -Dspotless.check.skip=true because the unleash-plugin breaks the pom-format when switching versions and spotless would fail.

openhab-bot commented 3 years ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/bmw-connecteddrive-binding/105124/94

lolodomo commented 3 years ago

Is there a need to maintain this issue still opened?