[SOLVED] Trouble with new bundle build: [ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.2.4:verify

Whilst following the guide here to convert a binding from old to new build system:

https://github.com/maggu2810/openhab-dev-doc/blob/master/maven-bnd.md

I am getting this error despite having gotten a few other bindings converted successfully, hence why I’m guessing this is dependency (netty) related. Hopefully someone can spot my mistake?

[WARNING] Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-binding-ipcamera; type=karaf.feature; version=2.5.0.SNAPSHOT; filter:="(&(osgi.identity=openhab-binding-ipcamera)(type=karaf.feature)(version>=2.5.0.SNAPSHOT))" [caused by: Unable to resolve openhab-binding-ipcamera/2.5.0.SNAPSHOT: missing requirement [openhab-binding-ipcamera/2.5.0.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.binding.ipcamera; type=osgi.bundle; version="[2.5.0.201905181328,2.5.0.201905181328]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.binding.ipcamera/2.5.0.201905181328: missing requirement [org.openhab.binding.ipcamera/2.5.0.201905181328] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.soap)"]]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:56 min
[INFO] Finished at: 2019-05-18T23:29:58+10:00
[INFO] Final Memory: 50M/246M
[DEBUG] Connection manager is shutting down
[INFO] ------------------------------------------------------------------------
[DEBUG] Connection manager shut down
[ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.2.4:verify (karaf-feature-verification) on project org.openhab.binding.ipcamera: Feature resolution failed for [openhab-binding-ipcamera/2.5.0.SNAPSHOT]
[ERROR] Message: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-binding-ipcamera; type=karaf.feature; version=2.5.0.SNAPSHOT; filter:="(&(osgi.identity=openhab-binding-ipcamera)(type=karaf.feature)(version>=2.5.0.SNAPSHOT))" [caused by: Unable to resolve openhab-binding-ipcamera/2.5.0.SNAPSHOT: missing requirement [openhab-binding-ipcamera/2.5.0.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.binding.ipcamera; type=osgi.bundle; version="[2.5.0.201905181328,2.5.0.201905181328]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.binding.ipcamera/2.5.0.201905181328: missing requirement [org.openhab.binding.ipcamera/2.5.0.201905181328] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.soap)"]]
[ERROR] Repositories: {
[ERROR]         file:C:\Users\Matt\git\openhab2-addons\bundles\org.openhab.binding.ipcamera\target/feature/feature.xml
[ERROR]         mvn:org.apache.karaf.features/framework/4.2.4/xml/features
[ERROR]         mvn:org.apache.karaf.features/standard/4.2.4/xml/features
[ERROR]         mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/2.5.0-SNAPSHOT/xml/features
[ERROR]         mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-tp/2.5.0-SNAPSHOT/xml/features
[ERROR]         mvn:org.ops4j.pax.web/pax-web-features/7.2.8/xml/features
[ERROR] }
[ERROR] Resources: {
[ERROR]         mvn:com.eclipsesource.jaxrs/publisher/5.3.1
[ERROR]         mvn:com.google.guava/guava/18.0
[ERROR]         mvn:com.google.guava/guava/21.0
[ERROR]         mvn:commons-codec/commons-codec/1.6
continues on with many more errors...

The entire source for the binding can be found here…

Did you rebase on latest master? There have been some changes to feature verification since it was first introduced.

running mvn clean; mvn compile on openhab-core gives me these errors:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:33 min
[INFO] Finished at: 2019-05-18T15:30:34-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.2.4:verify (karaf-feature-verification) on project org.openhab.core.features.karaf.openhab-core: Feature resolution failed for [openhab-core-base/2.5.0.SNAPSHOT]
[ERROR] Message: org.apache.karaf.features.internal.util.MultiException: Error:
[ERROR] /home/steve/Projects/openhab/openhab-core/bundles/org.openhab.core.io.http/target/classes (Is a directory)
[ERROR] /home/steve/Projects/openhab/openhab-core/bundles/org.openhab.core.thing.xml/target/classes (Is a directory)

Is this the same issue?

Steve

I am getting convinced it has to do with the location of the feature.xml file despite I have copied what other bindings have done, it comes up with the output below. The folder C:\Users\Matt\git\openhab2-addons\features\openhab-addons\src\main\feature is missing and I have tried placing my feature.xml in this location which does not solve the errors it only gets rid of the warning that the file is missing. Checking the github project and the file for that location is also missing despite other posts here linking to it…

Why do all the merged bundles have the file located here and it works, yet mine does not?

C:\Users\Matt\git\openhab2-addons\bundles\org.openhab.binding.astro\src\main\feature

Output from doing a ‘mvn clean install’ inside my bindings folder…

[WARNING] Could not find file feature file features/openhab-addons/src/main/feature/feature.xml
[INFO]
[INFO] --- sat-plugin:0.6.1:pmd (sat-all) @ org.openhab.binding.ipcamera ---
[INFO] Adding dependency to pmd:0.6.1
[INFO] Adding dependency to pmd-core:6.7.0
[INFO] Adding dependency to pmd-java:6.7.0
[INFO] Adding dependency to pmd-javascript:6.7.0
[INFO] Adding dependency to pmd-jsp:6.7.0
[INFO]
[INFO] --- sat-plugin:0.6.1:spotbugs (sat-all) @ org.openhab.binding.ipcamera ---
[INFO] Adding dependency to findbugs:0.6.1
[INFO] Adding dependency to bug-pattern:1.2.4
[INFO] Adding dependency to spotbugs:3.1.7
[INFO] Fork Value is false
     [java] JVM args ignored when same JVM is used.
     [java] Warnings generated: 6
[INFO] Done SpotBugs Analysis....
[INFO]
[INFO] --- sat-plugin:0.6.1:report (sat-all) @ org.openhab.binding.ipcamera ---
[INFO] No reports found !
[INFO]
[INFO] --- karaf-maven-plugin:4.2.4:verify (karaf-feature-verification) @ org.openhab.binding.ipcamera ---
[INFO] Using repositories: https://openhab.jfrog.io/openhab/libs-snapshot@id=openhab-artifactory-snapshot@noreleases@snapshots,https://jcenter.bintray.com@id=jcenter,https://openhab.jfrog.io/openhab/libs-release@id=openhab-artifactory-release,https://repo.maven.apache.org/maven2@id=central
[INFO] Unable to determine whether the meta annotation com.oracle.svm.core.annotate.Alias applied to type io.netty.util.internal.svm.CleanerJava6Substitution provides bundle annotations as it is not on the project build path. If this annotation does provide bundle annotations then it must be present on the build path in order to be processed
[INFO] Unable to determine whether the meta annotation com.oracle.svm.core.annotate.RecomputeFieldValue applied to type io.netty.util.internal.svm.CleanerJava6Substitution provides bundle annotations as it is not on the project build path. If this annotation does provide bundle annotations then it must be present on the build path in order to be processed
[INFO] Unable to determine whether the meta annotation com.oracle.svm.core.annotate.TargetClass applied to type io.netty.util.internal.svm.CleanerJava6Substitution provides bundle annotations as it is not on the project build path. If this annotation does provide bundle annotations then it must be present on the build path in order to be processed
[WARNING] Feature resolution failed for [openhab-binding-ipcamera/2.5.0.SNAPSHOT]
Message: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-binding-ipcamera; type=karaf.feature; version=2.5.0.SNAPSHOT; filter:="(&(osgi.identity=openhab-binding-ipcamera)(type=karaf.feature)(version>=2.5.0.SNAPSHOT))" [caused by: Unable to resolve openhab-binding-ipcamera/2.5.0.SNAPSHOT: missing requirement [openhab-binding-ipcamera/2.5.0.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.binding.ipcamera; type=osgi.bundle; version="[2.5.0.201905182354,2.5.0.201905182354]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.binding.ipcamera/2.5.0.201905182354: missing requirement [org.openhab.binding.ipcamera/2.5.0.201905182354] osgi.wiring.package; filter:="(osgi.wiring.package=javax.xml.soap)"]]
Repositories: {
        file:C:\Users\Matt\git\openhab2-addons\bundles\org.openhab.binding.ipcamera\target/feature/feature.xml
        mvn:org.apache.karaf.features/framework/4.2.4/xml/features
        mvn:org.apache.karaf.features/standard/4.2.4/xml/features
        mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/2.5.0-SNAPSHOT/xml/features
        mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-tp/2.5.0-SNAPSHOT/xml/features
        mvn:org.ops4j.pax.web/pax-web-features/7.2.8/xml/features
}
Resources: {
        mvn:com.eclipsesource.jaxrs/publisher/5.3.1
        mvn:com.google.guava/guava/18.0

@J-N-K
What would I rebase and how to do it? I have run “mvn clean install -U” with the -U option

I only set this up 1 day ago from scratch, I did a rebase with egit on the following which made no difference.

  1. openhab-demo (guessing this is the run environment which I have working with paperUI but my binding will not show yet as the mvn build fails)
  2. openhab-addons : my binding is not merged yet but I did it anyway and have been going through other bindings to see what they have done and I am now at a dead end with everything I can think of having already tried. running mvn clean install works for other bindings, just not mine.

almost the same problem with my project:

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.2.4:verify (karaf-feature-verification) on project org.openhab.binding.openwms: Feature resolution failed for [openhab-binding-openwms/2.5.0.SNAPSHOT]
[ERROR] Message: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-binding-openwms; type=karaf.feature; version=2.5.0.SNAPSHOT; filter:="(&(osgi.identity=openhab-binding-openwms)(type=karaf.feature)(version>=2.5.0.SNAPSHOT))" [caused by: Unable to resolve openhab-binding-openwms/2.5.0.SNAPSHOT: missing requirement [openhab-binding-openwms/2.5.0.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.binding.openwms; type=osgi.bundle; version="[2.5.0.201905190536,2.5.0.201905190536]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.binding.openwms/2.5.0.201905190536: missing requirement [org.openhab.binding.openwms/2.5.0.201905190536] osgi.wiring.package; filter:="(osgi.wiring.package=org.slf4j.impl)"]]
[ERROR] Repositories: {
[ERROR]         file:C:\Users\Rainer\eclipse-workspace\openhab2-addons\bundles\org.openhab.binding.openwms\target/feature/feature.xml
[ERROR]         mvn:org.apache.karaf.features/framework/4.2.4/xml/features
[ERROR]         mvn:org.apache.karaf.features/standard/4.2.4/xml/features
[ERROR]         mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/2.5.0-SNAPSHOT/xml/features
[ERROR]         mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-tp/2.5.0-SNAPSHOT/xml/features
[ERROR]         mvn:org.ops4j.pax.web/pax-web-features/7.2.8/xml/features
[ERROR] }
[ERROR] Resources: {
[ERROR]         mvn:com.eclipsesource.jaxrs/publisher/5.3.1
[ERROR]         mvn:com.google.guava/guava/18.0
[ERROR]         mvn:com.google.guava/guava/21.0
[ERROR]         mvn:commons-codec/commons-codec/1.6
[ERROR]         mvn:commons-collections/commons-collections/3.2.1

I have converted my binding from old to new build system as described but runnig mvn clean gives me these errors.
Does anyone have a hint what this could be or where I need to look to go ahead?

Thanks in advance.
rainer

edit…

There was probably a bug in my feature.xml file.
I recreated the file again (as described in this link) and now the mnv clean install does not fail.

1 Like

I finally solved it and for me it was a missing dependency that Eclipse did not complain about, yet the maven/bnd build system had issues. Mine was javax.xml.soap due to the error being so long and cryptic it took far too long to discover this because the old build system handled the java lib itself.

I added the required lines to the feature.xml file and pom.xml and it built first try.

@rainer300
In your log you posted above the key info to solve it is the second error line and you have to scroll across to the very end to get the key piece of information.

In your case the missing dependency is this …

osgi.wiring.package=org.slf4j.impl

@matt1
Thank you for your help.

Now I have the next problem when pressing the resolve button in the app-bndrun:

Do you have a hint where I can find the cause of the error or which settings are still missing?

Many thanks in advance.
rainer

Sorry I am new to all of this and have no idea. Your already further into then I am as I had three bindings to convert and very limited time. I recommend you start your own thread.