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


(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


(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>