Recently I am working on using ProvToolbox https://lucmoreau.github.io/ProvToolbox/ in my developed binding. At first, I just treated it as a maven dependency and use it. However it fails, because the ProvToolbox is not an OSGI bundle. Even if I try to transform it to an OSGI bundle, there are many dependency issues when dealing with karaf-feature-verify goal and bndrun resolution.
So I give up this way, and follow Łukasz Dywicki’s advice in [SOLVED] An error occurred when I tried to include external packages to my current binding. I try to copy each package in ProvToolbox into my binding. What I do is simple:
- Create empty packages with the same name as those in ProvToolbox.
- Copy each file into the empty packages
- Because ProvToolbox is built in maven, for each package in ProvToolbox, I also copied the corresponding dependencies into my binding’s pom.xml.
Using this way, I successfuly migrated prov-model package(https://github.com/lucmoreau/ProvToolbox/tree/master/prov-model). However, when I dealt with prov-xml(https://github.com/lucmoreau/ProvToolbox/tree/master/prov-xml), problem happened. Inside prov-xml, it uses XmlJavaTypeAdapter. Here is an example.
@XmlJavaTypeAdapter( QualifiedNameAdapter.class )
protected org.openprovenance.prov.model.QualifiedName id;
where QualifiedNameAdapter is a class which extends XmlAdapter.
public class QualifiedNameAdapter extends XmlAdapter<QName, org.openprovenance.prov.model.QualifiedName>
Everything looks fine, but when I execute
mvn clean install of my binding, every part which uses XmlAdapter in prov-xml package all falied.
What I tried to debug
I first downloaded the source code of ProvToolbox from github, and build the version 0.7.3 of ProvToolbox using maven, it succeeded ( Note that I copied ProvToolbox with version 0.7.3 into my binding ).
Then I copied the maven-compiler-plugin part of my openHAB binding to the pom.xml of ProvToolbox, to check if it is related with the compiler, it can also succeed. So the problem is that, ProvToolbox can be successfully built, but it can not be used in my binding. Can anyone give me some hints? Thanks a lot!