Hello,
I’m trying out developing some bundles (not bindings) for openhab 2.5.0, and i cannot seem to find how to resolve imports between the 2 bundles i created.
What i did:
- Setup eclipse with bndtools and openhab
- Downloaded openhab2-addons package
- Imported openhab2-addons into eclipse
- Created project “org.openhab.homematic.tracker”
- Created a pom.xml for this project:
....
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.0-SNAPSHOT</version>
</parent>
<artifactId>org.openhab.homematic.tracker</artifactId>
- Added this project to the “openhab2-addons/bundles” folder
- In the “openhab2-addons/bundles/pom.xml” put:
...
<module>org.openhab.homematic.tracker</module>
...
- In the “openhab2-addons/bom/openhab-addons/pom.xml” put:
...
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.homematic.tracker</artifactId>
<version>2.5.0-SNAPSHOT</version>
</dependency>
...
- In the “openhab2-addons/features/openhab-addons/src/main/feature/feature.xml” put:
...
<feature name="openahb-homematic-tracker" description="Homematic Tracker" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.homematic.tracker/${project.version}</bundle>
</feature>
...
- Did the same as above for the second project “org.openhab.lamp.responder”, which has a reference to the first project service, so it also imports one class from that project.
The import resolved in the workspace , but once i try doing
mvn clean install -DskipTest -DskipChecks
in “openhab2-addons/bundles” folder, i get an error for my “org.openhab.lamp.responder” project, saying it cannot resolve the class it is importing from my “org.openhab.homematic.tracker” project.
Everything else resolves and compiles when i skip my “org.openhab.lamp.responder” in maven compilation. “org.openhab.homematic.tracker” project which exports that class compiles and in the generated jar the manifest has the export lines for the needed packages.
Any ideas, tips or suggestions? I tried looking at other bundles in the “openhab2-addons/bundles”, but could not find anything that is different from my bundles. I’m kind of running low on ideas.