Maven build problem OpenHAB.getVersion()

I’m working on a service binding under 2.1.0 snapshot and wold like to make it also function under the current stable 2.0.0 version. Trying to use OpenHAB.getVersion() to adapt the code. Compiles and runs fine under eclipse but when I build the snapshot using mvn it report “can’t find org.openhab.core 0.0.0”. I can’t figure out how to fix the build. Any help would be appreciated.

I had the same issue a couple of minutes ago.
After doing a complete “mvn clean install”, not just for my binding, everything was fine.

Careful, I used the same class / method and learned later on that org.openhab.core should not be used by bindings:

https://github.com/openhab/openhab2-addons/pull/2372#issuecomment-308567899