Hi all,
Im trying to develop a binding to pull microsoft todo (can be extended to all microsoft apps) binding for openhab.
I have got a POC working for the main code in my “Playground” so have tried to move it over into openhab as a binding.
I tried adding them one by one into features.xml but get to a point where it fails on a dep i dont know what it is or where to find it.
I have also tried gathering all dependencies (by running dependency:copy-dependencies) and droping them in the lib folder but again it then fails for a package i cant find anywhere.
All my code is here:
Any help would be really appreciated! pulling my hair out here!
Code updated on github…
Does this manage transitives as well? or do i have to manually add each to the pom?
Ive removed all the feature stuff i put in. and instead simply fixed up jenkins versions (same way as was done in another binding)
but now it is failing to verify due below: im pretty sure that nothing else is using Microsoft graph so dont think there is a conflicting version here
Github updated…
From looking around it seems that you do need to manually add al transitive dependencies.
I am going through updating the pom, seeing what fails updating the pom repeat.
Is there a better way to do this? Can you confirm i am on the correct path now and not doing something else super silly!
Also is there an easy way to go from package failure error message to required dependency? some are difficult to deduce where they are coming from.
I find this the most difficult part of setting up dependencies, and I’ve not found a better way to do it. Once I figured out to stop trying to read the whole error message and just look at the last bit, it got a little better (but not much). Hopefully someone will chime in with a better approach.
Seems there is already msgraph-sdk-java#328 to get it removed so maybe a small PR can fix it upstream?
If that isn’t resolved quickly we could create our own bundle for it and use that
Another option is to add the sources of microsoft-graph to the add-on and rework the code to remove the dependency on Jersey, like we did for lametrictime and sleepiq
So for my understanding, sorry if these are stupid A’s
What do you mean by PR,
What is the issue with the jersey dependency?
How do you know that that is what has caused this issue?
What do you mean by creating our own bundle? Is this an OSGI bundle?
Final one you mean cloning the repo for ask, copying it in, and then adjusting the code so we can get rid of Jersy?
What would we want to use instead?
Pull request to fix the dependency issue in that library. As you can read in the issue others are also not happy about it, so if it’s fixed in the Microsoft repo everybody will be happy again.
It’s a huge dependency. It’s a specific implementation that won’t be available in OH3 anymore when openhab-core#1443 is merged. It doesn’t make sense for a client library to depend on such server dependencies.
Yes an OSGi bundle that’s the same as the current one but with a fix to remove that dependency. I.e. a fork of the Microsoft code.
Copying in the Java classes that you use in your add-on and putting them in a 3rdparty dir so the origin/license is clear. When Microsoft fixes the issue you can remove that code and use their bundle again.
Got you,
And is there anyway of knowing that this is the issue without simply knowing that this is a huge dependency and cause issues haha?
Like what could I have seen in the logs that showed that this was the main pain point?
right,
So i’ve just added all the microsoft files under a loc pacakge called third party,
Not sure if ive screwed something, but it it still all compiling without the jersy dep.
Its still failing due to other dependencies in OSGI, am i back on the right path now?
(github updating)
Thanks,
Alex
Ive gone through all transitive deps on maven repo,
Not sure if i’m being an idiot but not sure where all these google ones are coming from!
current one is “com.google.appengine.api”
right, so final update of the day haha.
Ive gone through all the transative dependencies and added them in,
Ive removed jersey from the pom of the microsoft graph and added the whole project to the forked openhab.
I am now having issues with: [ERROR] C:\Users\gener\IdeaProjects\openhab-addons3\bundles\org.openhab.binding.microsofttotodo\pom.xml [0:0]: Classes found in the wrong directory: {META-INF/versions/9/module-info.class=module-info}
I added <configuration> <rules><dependencyConvergence/></rules> </configuration>
to the maven enforcer plugin to help remove conflicting versions.
All the dependencies in the new binding are on the same version, the only conflicting versions seem to be in the core bundles. But i am still seeing the error above.
Any ideas?
(Github updated)
fyi, managed to get it all working,
Not release’able yet as all of the config is hardcoded but i may be able to tidy it up this weekend and put up a poc if people are interested?