Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update feature name #610

Merged
merged 2 commits into from
Oct 3, 2020
Merged

Update feature name #610

merged 2 commits into from
Oct 3, 2020

Conversation

cdjackson
Copy link
Contributor

@wborn this ought to resolve openhab/openhab-distro#1158

Signed-off-by: Chris Jackson [email protected]

@wborn
Copy link
Member

wborn commented Oct 3, 2020

No that won't work, I already tried that.

The issue is that the plugin will still add the generated feature using the artifactId name:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="feature">
    <feature name="openhab-binding-zigbee" description="openHAB ZigBee Binding" version="3.0.0.SNAPSHOT">
        <feature>openhab-runtime-base</feature>
        <feature>openhab-transport-serial</feature>
    </feature>
    <feature name="org.openhab.addons.features.karaf.zigbee" description="openHAB Add-ons :: Features :: Karaf :: openHAB ZigBee Binding" version="3.0.0.SNAPSHOT">
        <details>This project contains the official add-ons of openHAB</details>
        <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.zigbee/3.0.0-SNAPSHOT</bundle>
        <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.zigbee.cc2531/3.0.0-SNAPSHOT</bundle>
        <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.zigbee.console/3.0.0-SNAPSHOT</bundle>
        <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.zigbee.console.ember/3.0.0-SNAPSHOT</bundle>
        <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.zigbee.console.telegesis/3.0.0-SNAPSHOT</bundle>
        <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.zigbee.ember/3.0.0-SNAPSHOT</bundle>
        <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.zigbee.telegesis/3.0.0-SNAPSHOT</bundle>
        <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.zigbee.xbee/3.0.0-SNAPSHOT</bundle>
        <bundle start-level="80">mvn:com.zsmartsystems.zigbee/com.zsmartsystems.zigbee/1.3.8</bundle>
        <bundle start-level="80">mvn:com.zsmartsystems.zigbee/com.zsmartsystems.zigbee.dongle.ember/1.3.8</bundle>
        <bundle start-level="80">mvn:com.zsmartsystems.zigbee/com.zsmartsystems.zigbee.dongle.telegesis/1.3.8</bundle>
        <bundle start-level="80">mvn:com.zsmartsystems.zigbee/com.zsmartsystems.zigbee.dongle.cc2531/1.3.8</bundle>
        <bundle start-level="80">mvn:com.zsmartsystems.zigbee/com.zsmartsystems.zigbee.dongle.xbee/1.3.8</bundle>
        <bundle start-level="80">mvn:com.zsmartsystems.zigbee/com.zsmartsystems.zigbee.console/1.3.8</bundle>
        <bundle start-level="80">mvn:com.zsmartsystems.zigbee/com.zsmartsystems.zigbee.console.ember/1.3.8</bundle>
        <bundle start-level="80">mvn:com.zsmartsystems.zigbee/com.zsmartsystems.zigbee.console.telegesis/1.3.8</bundle>
    </feature>
</features>

Maybe the karaf-maven-plugin has a configuration property to override the feature name.
We can also add a dependency in the openhab-binding-zigbee feature on the generated feature.
Or if all else fails, just change the artifactId to openhab-binding-zigbee ;-)

Signed-off-by: Chris Jackson <[email protected]>
@cdjackson
Copy link
Contributor Author

Updating the artifactId seems simplest - I assume there's no other dependency on this, and it resolves the issue.

@wborn
Copy link
Member

wborn commented Oct 3, 2020

I think the org.openhab.binding.zigbee.serial should also be added to the POM so it is added to the generated feature?

I tried installing the add-on but it was not happy:

org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-binding-zigbee; type=karaf.feature; version="[3.0.0.SNAPSHOT,3.0.0.SNAPSHOT]"; filter:="(&(osgi.identity=openhab-binding-zigbee)(type=karaf.feature)(version>=3.0.0.SNAPSHOT)(version<=3.0.0.SNAPSHOT))" [caused by: Unable to resolve openhab-binding-zigbee/3.0.0.SNAPSHOT: missing requirement [openhab-binding-zigbee/3.0.0.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.binding.zigbee.ember; type=osgi.bundle; version="[3.0.0.202010030953,3.0.0.202010030953]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.binding.zigbee.ember/3.0.0.202010030953: missing requirement [org.openhab.binding.zigbee.ember/3.0.0.202010030953] osgi.wiring.package; filter:="(osgi.wiring.package=org.openhab.binding.zigbee.serial)"]]

@cdjackson
Copy link
Contributor Author

cdjackson commented Oct 3, 2020 via email

Signed-off-by: Chris Jackson <[email protected]>
Copy link
Member

@wborn wborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will work. 👍 We can look into changing the artifactId some other time.

@cdjackson
Copy link
Contributor Author

cdjackson commented Oct 3, 2020 via email

@wborn
Copy link
Member

wborn commented Oct 3, 2020

If we want to follow some sort of naming convention for feature artifactIds it would be nice if we can find a way to make Karaf generate feature name independent of the artifactId. But there are already a couple of naming schemes so it's nice to have.

Another improvement may be to also use feature validation of the Karaf Maven plugin which would prevent issues such as that missing org.openhab.binding.zigbee.serial bundle.

@cdjackson cdjackson closed this Oct 3, 2020
@cdjackson cdjackson reopened this Oct 3, 2020
@cdjackson cdjackson merged commit cba4ca8 into openhab:master Oct 3, 2020
@cdjackson cdjackson deleted the feature_name branch October 3, 2020 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants