Adaptions in feature.xml in own project

(Jochen Bauer) #1

Dear Community,

When developing a new binding you need to make changes to two xml files: feature.xml and pom.xml. The pom.xml file is in the same java project and branch, but the feature.xml is at another location. So how to commit the new binding then - do you need to make a PR to two projects, openhab-distro and openhab-addons?

Thanks in advance.

Best regards,
Jochen

0 Likes

(Hilbrand Bouwkamp) #2

The feature file is also in the open2-addons repository. In feature directory. You need to add to that file: https://github.com/openhab/openhab2-addons/blob/master/features/karaf/openhab-addons/src/main/feature/feature.xml

0 Likes

Trouble with new bundle build: [ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.2.4:verify
(David Graeff) #3

I do wonder though, if we can have a feature.xml per project (that would also be part of the skeleton binding), for example:

<features name="${project.artifactId}-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
    <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features</repository>
    <feature name="openhab-binding-airquality" description="Air Quality Binding" version="${project.version}">
        <feature>openhab-runtime-base</feature>
        <bundle start-level="80">mvn:org.openhab.binding/org.openhab.binding.airquality/${project.version}</bundle>
    </feature>
</features>

and combine all those in the root pom with something like:

<plugin> 
    <groupId>org.apache.karaf.tooling</groupId> 
    <artifactId>karaf-maven-plugin</artifactId> 
    <configuration> 
      <aggregateFeatures>true</aggregateFeatures> 
    </configuration> 
</plugin> 
2 Likes

(Skinah) #4

Was this implemented, if so where can I learn more how to get a working feature and pom combination? the file @hilbrand linked to is now missing and I notice that each binding has its own feature.xml located at…

openhab2-addons\bundles\org.openhab.binding.astro\src\main\feature

0 Likes

(David Graeff) #5

Developer docs -> Buildsystem maybe

0 Likes