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 -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( ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start( ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle( ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles( ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles( ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess( ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process( ~[?:?]
	at ~[?:?]

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.