Maven dependencies cannot be resolved - Non-resolvable parent POM

I have followed the IDE Setup and Developing Bindings articles over at http://docs.openhab.org/developers/ but i am unable to run/debug when i try to develop a new binding using the skeleton script.
I get the following on a completely clean environment when running ‘mvn clean’

[FATAL] Non-resolvable parent POM for org.openhab.binding:org.openhab.binding.unifi:2.0.0-SNAPSHOT: Could not find artifact org.openhab.binding:pom:pom:2.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 6, column 11
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project org.openhab.binding:org.openhab.binding.unifi:2.0.0-SNAPSHOT (/Users/rs/openhab2-master/git/openhab2-addons/addons/binding/org.openhab.binding.unifi/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for org.openhab.binding:org.openhab.binding.unifi:2.0.0-SNAPSHOT: Could not find artifact org.openhab.binding:pom:pom:2.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 6, column 11 -> [Help 2]

If u run mvn clean on an existing binding i get another error which seems related to Tycho:

[ERROR] Internal error: java.lang.RuntimeException: org.apache.maven.MavenExecutionException: Could not setup plugin ClassRealm: Failed to parse plugin descriptor for org.eclipse.tycho:tycho-p2-plugin:0.24.0 (/Users/rs/.m2/repository/org/eclipse/tycho/tycho-p2-plugin/0.24.0/tycho-p2-plugin-0.24.0.jar): invalid END header (bad central directory offset) -> [Help 1]

This being a completely clean setup (new Eclipse install on a Mac) i am afraid i am missing something obvious here?
Should i manually have added the org.openhab.binding dependency and/or why is that not resolved by the parent pom?

Thanks -

Tycho is indeed quite specific in that area. Build first everything (from console) and then parent should get resolved. It might be an issue of missing p2 (provisioning mechanism for eclipse and tycho based builds) on clean environment. I didnt check OH repositories yet and dont know if there is actually p2 repo with addons.
Second message looks like resolution error caused by malformed JAR in repo. Try removing that jar and ket maven download it again. It is quite standard issue when using hotspots, then before auth first downloaded jar will have htm content. :slight_smile:

1 Like

I tried running mvn install for the openhab-distro which did run successfully however i still get parent.relativePath errors for all bindings.
My structure under git looks like this:

openhab-distro
openhab2-addons
smarthome

anything i run in terms of maven under openhab2-addons fails with that Non-resolvable parent POM error as stated above.

Is there anything else which i would manually need to setup or import to get what i have followed in the developer guide to work?

Thanks -

Distro should be built after addons. Build order is following - smarthome, openhab-core, openhab2-addons, openhab-distro.

So now - since you tested that already please try changing parent version (and your binding version as well) to <version>2.1.0-SNAPSHOT</version>. OH 2.0 was already released and version numbers were rised up. Anyhow if this doesn’t help please push your binding somewhere so I will try to build it too.

First setting it to version 2.1.0 for both OH and the binding and then i got the same error as the other bindings but deleting the bad Tycho JAR and re-downloading did the trick!
Now i can mvn packagemy binding.
However - i still cannot run/debug the actual OH project like shown in this screencast: https://www.youtube.com/watch?v=30nhm0yIcvA
I get:

org.osgi.framework.BundleException: Exception in org.eclipse.equinox.internal.simpleconfigurator.Activator.start() of bundle org.eclipse.equinox.simpleconfigurator.

and a bunch of other exceptions which seems to be due to missing dependencies. I have tried to clean the entire project and build again but i still end up with 20+ packages that cannot be resolved.