Cross compiling for 3.4.x and 4.0.x

I have been trying to compile the bundle connectedcar to work under openHAB 3.4.x and 4.0.x at the same time.

I am starting in the 4.0.x branch with Java 17 and a mvn clean install -pl :org.openhab.binding.connectedcar gives a working version for 4.0.x.

Then I tried mvn clean install -pl :org.openhab.binding.connectedcar -Dohc.version=3.4.0 -Doh.java.version=11 -Dkaraf.version=4.3.7 which gives a version for 3.4.x. However, when I try this version under 4.0.x I get the following error on load:

org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.connectedcar [241]
  Unresolved requirement: Import-Package: io.micrometer.core.lang; version="[3.4.0,4.0.0)"

	at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) ~[?:?]

Any ideas?

Thats not going to work, you need one version for openHAB 3.x and one for 4.x.
You need to have binding.xml and addon.xml under oh-inf folder.

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.