Upgrading binding to 2.5.2-SNAPSHOT - dependency hell

Hello everyone!
I have bought a newer, better desktop PC and migrating devismart binding development to it. On my laptop the IDE has been setup in 2.5.0-SNAPSHOT times and everything worked.
So, i have followed Eclipse setup instructions at https://www.openhab.org/docs/developer/ide/eclipse.html , so i’ve got the infrastructure plus two git repos checked out. I have added my devismart binding to pom.xml files; everything went fine until i tried to build the project. Everything failed.
I have found out that i needed to fix version number in my binding (the new infra expects 2.5.2-SNAPSHOT instead of 2.5.0-SNAPSHOT), and also in openhab-distro/launch/app/pom.xml the version was still set to 2.5.1-SNAPSHOT. After this i was able to build, but “Resolve” in app.bndrun now gives:

Resolution failed. Capabilities satisfying the following requirements could not be found:
[<>]
⇒ osgi.identity: (osgi.identity=org.openhab.binding.devireg)
⇒ [org.openhab.binding.devireg version=2.5.2.202002202224]
⇒ osgi.wiring.package: (&(osgi.wiring.package=net.minidev.json)(&(version>=2.3.0)(!(version>=3.0.0))))
⇒ [net.minidev.json-smart version=2.3.0]
⇒ osgi.wiring.package: (&(osgi.wiring.package=net.minidev.asm)(&(version>=1.2.0)(!(version>=2.0.0))))
⇒ [net.minidev.accessors-smart version=1.2.0]
⇒ osgi.wiring.package: (&(osgi.wiring.package=org.objectweb.asm)(&(version>=5.0.0)(!(version>=6.0.0))))

Apparently there’s something broken. It looks like it cannot find appropriate version of org.objectweb.asm. I’ve checked openhab-addons repo, some bindings still refer to net.minidev.json v2.3. So it should be valid. Can anyone explain me how to fix this ?

Meanwhile i’ll try to roll back to earlier commits of the infrastructure repo. May be 2.5.1 release will work.

I may be wrong, but now that 2.5.2 is released, there are likely no 2.5.2 SNAPSHOTs

Look at git repos; HEAD of 2.5.x branches. This version string is still there.

1 Like

Checked out at revisions:
openhab-distro: d58c630f189c76862f5f4664caacbc585887bd78
openhab-addons: 35792c7350d3fd2a8155b0ad6a40c19d84f7cdc9
i. e. right after removing SNAPSHOT and setting 2.5.1 release tag. The problem with resolving packages persists. It looks like i’m in some trouble and need help. Anyone ? Developers ?

I’ve tried rebuild and re-resolve on my laptop and got the same error. Apparently something got broken.
Ok, let’s put the question in different way. I need a JSON parser and creator. What is currently used by OpenHAB? I want to reuse it in order not to add more dependencies.

I’ve scanned for “json” string pom.xml files in addons repo; all of them use org.json. I don’t remember where i found net.minidev.json-smart, but it seems it has been dropped. So i switched to org.json too. The problem solved.

If you need json parsing you should use gson. It’s included by default and used by most bindings.

1 Like

@hilbrand thank you! I will change it again.