I started to develop an add-on to support InfluxDB v2, firstly for personal use to play with new InfluxDB APIs and features but also to get some experience with Openhab addons developments.
Now it’s only personal but I want to do in the correct way to be able to ask if it can be integrated in the future.
I started making a copy of @dominikkv work in https://github.com/dominikkv/openhab2-addons/tree/influxdb-neo and done some refactors and changes to adapt to the new and incompatible InfluxDB2 API, I named the copy org.openhab.persistence.influxdb2.
After some work I had a first parcial work to try and started to deploy it to local development 2.5.0 openhab snapshot and then the problems started
The dependencies that I need for the module are:
com.influxdb:influxdb-client-java:1.2.0
com.influxdb:flux-dsl:1.2.0
And it’s dependencies that are quite a lot.
I read OpenHab documentation regarding Osgi and I started with the dependencies and the pom and this in feature.xml:
<bundle dependency="true">wrap:mvn:com.influxdb/influxdb-client-java/1.1.0$Bundle-Name=InfluxDBClientJava&Bundle-SymbolicName=com.influxdb.influxdb-client-java&Bundle-Version=1.1.0"</bundle>
<bundle dependency="true">wrap:mvn:com.influxdb/flux-dsl/1.1.0$Bundle-Name=InfluxDB Flux DSL&Bundle-SymbolicName=com.influxdb.flux-dsl&Bundle-Version=1.1.0"</bundle>
I realized that I will also need to include the transitive dependencies and I added also using mvn and wrap:mvn dependencies
As karaf was complaining about not found dependencies I started to check in console and I was not able to see that dependencies deployed.
Then I decided to reduce it to the minimum expression and do a new empty module using addon wizard and add only one of the dependencies as a module. That is an empty pom.xml and this in feature.xml:
<feature>openhab-runtime-base</feature>
<feature prerequisite="true">wrap</feature>
<bundle dependency="true">wrap:mvn:io.gsonfire/gson-fire/1.8.0</bundle>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.mytestbinding/2.5.0-SNAPSHOT</bundle>
With this I realized that the wrapped modules doesn’t install in Karaf, searching I found this issue about problems with wrapped modules, and the fact that in 2.5.0 there won’t be wrapped modules, and instead OSGi adaptions are made and uploaded to a repository.
My questions are:
How I had to proceed to develop my module?
I understand that I can’t upload new modules to the OSGi repository.
What is the easiest way to proceed for me to develop locally and test my module? Do the wrapped modules with Bnd and deploy manually to Karaf?
And what is the way to proceed if in the future I want to ask to integrate it with OpenHab.
Is ther any updated documentation?