Binding skeleton breaks build

I tried to create a new project with the binding skeleton but maven refuses to build it.

Environment

  • Linux
  • OpenJDK Runtime Environment (build 1.8.0_222-b05)
  • Apache Maven 3.6.1

Steps to reproduce:

  • git clone https://github.com/openhab/openhab2-addons.git
  • cd bundles
  • ./create_openhab_binding_skeleton.sh HelloWorld foo foo
  • cd org.openhab.binding.helloworld
  • mvn clean install -DskipTests -DskipChecks

Failed to execute goal org.commonjava.maven.plugins:directory-maven-plugin:0.3.1:directory-of (directories) on project org.openhab.binding.helloworld: Cannot find directory for project: org.openhab.addons:org.openhab.addons.reactor

If I try to build an existing binding the Astro binding I get the same error.

Ok I cleaned my maven cache to ensure that there is no old version of the archetype present but now the skeleton won’t work at all.
I created an issue: https://github.com/openhab/openhab2-addons/issues/5849

Hi Tim,

Thanks for looking into this. It looks like the (linux???) script puts the new binding id twice into the modules section of the POM file located in bundles/pom.xml. To resolve the build issues remove the inserted one at the end.

//CC @hilbrand Do you have any idea why this does happen?

Yes I know why (That is I don’t know why it broke, I guess the maven achetype plugin got updated?) I’ve created a fix: https://github.com/openhab/openhab-core/pull/936

Great. Thank you for the quick fix.

Hi,

I have followed the same procedure as specified by @t1m
On maven clean install i have got the same error :

Failed to execute goal org.commonjava.maven.plugins:directory-maven-plugin:0.3.1:directory-of (directories) on project org.openhab.binding.helloworld: Cannot find directory for project: org.openhab.addons:org.openhab.addons.reactor

I have checked in the location bundles/pom.xml. I am not able to find binding id twice but still i am getting the same error.

Please help me out in solving this.

Thank you

Try following the documentation instead of some old topic that might or might not be outdated: https://www.openhab.org/docs/developer/#develop-a-new-binding and make sure you have the latest openhab-addons snapshot checked out.