Hello everyone! I need help from someone who knows Maven, i guess…
I am working on rewriting OpenSDG library in Java. It will make better friendship with Maven repositories and finally enable to upstream my Danfoss binding.
For now i have the first release candidate of the library, working with the test app; and i started to adapt my binding. I’ve thrown away native binaries, “lib” folder with the JNI glue, and added a dependency to my library to pom.xml:
<dependency> <groupId>org.opensdg</groupId> <artifactId>osdg_java</artifactId> <version>1.0</version> </dependency>
It all looks good, Maven sees the dependency, it finds it from the workspace, the binding builds. But when i try to resolve app.bndrun i get “missing dependency” error. osdg_java appears to be missing.
I’ve examined jar contents. My binding also uses org.json, and from this i know that dependencies, which aren’t part of openhab core, will be automatically bundled in the binding’s .jar. Previously exactly this happened to org.json. Now, with the new version, dependency resolution magically stops working. I see neither opensdg nor org.json in the binding .jar.
Also, my library in turn uses some more libraries: jnacl and protobuf. These dependencies are also missing from my library’s jar. I am nor sure whether this is supposed behavior or not. Google told me that a plugin called maven-assembly-plugin is responsible for this behavior. For test purposes i tried to add it (as suggested, for instance, here java - Including dependencies in a jar with Maven - Stack Overflow ) to opensdg’s pom.xml No result, nothing changed, my dependencies are not linked in.
Could anyone kindly explain me what i am doing wrong? Frankly speaking i don’t understand Maven plugins and goals at all, so i am even unable to diagnose the problem myself.
Library’s code is here: GitHub - Sonic-Amiga/opensdg-java: Free and open SecureDeviceGrid protocol client side implementation in Java
Binding’s code is here: GitHub - Sonic-Amiga/org.openhab.binding.devireg at opensdg-java . See branch named “opensdg_java” for the modified version.