Hi
I am building my first binding, but ran in to some building issues. I am quite new to Java and Maven, so I am probably missing something basic…??
My development environment is set up according to https://www.openhab.org/docs/developer/#setup-the-development-environment, using VSCode as IDE. I am able to create the skeleton using this command “create_openhab_binding_skeleton.cmd” and it compiles fine using “mvn clean install -DskipChecks” within the binding.
But as as soon as I add dependencies like below, it will no longer build.
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.4.0</version>
<scope>compile</scope>
</dependency>
The new binding is added to pom.xml (in bundles folder) as a module
<module>org.openhab.binding.met</module>
Anything else I need to do in order to add dependencies?
I am not aloud to upload files so I just add an extract of the build log here.
First applicable warning:
[WARNING] Feature resolution failed for [openhab-binding-met/2.5.7.SNAPSHOT]
Message: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-binding-met; type=karaf.feature; version=2.5.7.SNAPSHOT; filter:="(&(osgi.identity=openhab-binding-met)(type=karaf.feature)(version>=2.5.7.SNAPSHOT))" [caused by: Unable to resolve openhab-binding-met/2.5.7.SNAPSHOT: missing requirement [openhab-binding-met/2.5.7.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.binding.met; type=osgi.bundle; version="[2.5.7.202007181104,2.5.7.202007181104]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.binding.met/2.5.7.202007181104: missing requirement [org.openhab.binding.met/2.5.7.202007181104] osgi.wiring.package; filter:="(osgi.wiring.package=com.fasterxml.jackson.core)"]]
Repositories: {
file:C:\Users\oyste\Development\openhab-addons\bundles\org.openhab.binding.met\target/feature/feature.xml
mvn:org.apache.karaf.features/framework/4.2.7/xml/features
mvn:org.apache.karaf.features/standard/4.2.7/xml/features
mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/2.5.0/xml/features
mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-tp/2.5.0/xml/features
mvn:org.ops4j.pax.web/pax-web-features/7.2.11/xml/features
}
First error:
[ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.2.7:verify (karaf-feature-verification) on project org.openhab.binding.met: Feature resolution failed for [openhab-binding-met/2.5.7.SNAPSHOT]
[ERROR] Message: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-binding-met; type=karaf.feature; version=2.5.7.SNAPSHOT; filter:="(&(osgi.identity=openhab-binding-met)(type=karaf.feature)(version>=2.5.7.SNAPSHOT))" [caused by: Unable to resolve openhab-binding-met/2.5.7.SNAPSHOT: missing requirement [openhab-binding-met/2.5.7.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.binding.met; type=osgi.bundle; version="[2.5.7.202007181104,2.5.7.202007181104]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.binding.met/2.5.7.202007181104: missing requirement [org.openhab.binding.met/2.5.7.202007181104] osgi.wiring.package; filter:="(osgi.wiring.package=com.fasterxml.jackson.core)"]]
[ERROR] Repositories: {
[ERROR] file:C:\Users\oyste\Development\openhab-addons\bundles\org.openhab.binding.met\target/feature/feature.xml
[ERROR] mvn:org.apache.karaf.features/framework/4.2.7/xml/features
[ERROR] mvn:org.apache.karaf.features/standard/4.2.7/xml/features
[ERROR] mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/2.5.0/xml/features
[ERROR] mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-tp/2.5.0/xml/features
[ERROR] mvn:org.ops4j.pax.web/pax-web-features/7.2.11/xml/features
[ERROR] }