Need some help with setup to create new binding using maven/bnd

Have you performed what I mentioned earlier about the “resolving” part?

Nevertheless, let’s ask @maggu2810. Can you have a look at the post from @Misiu above? Looks like the libraries that are in “lib” directories are not resolved.

I’ve tried all the possible thing I can think of.
I’ve imported project in different ways, I’ve tried Maven->Update Project, I’ve tried changing profiles using Maven->Select Maven Profiles.
I have my new binding almost ready (PCF8574 extender), but it is hard to test if if I can’t compile it :smiley:

Can you pleasae close the Eclipse IDE and run

mvn clean install -U

in the root of your working copy?

Please post the whole log.

Here is the full log, I wasn’t able to post it here, because it was too long.
openHAB_log.txt (138.6 KB)
there are couple of warnings while downloading dependencies and errors at the end:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for openHAB Demo 2.5.0-SNAPSHOT:
[INFO]
[INFO] openHAB Demo … SUCCESS [ 9.864 s]
[INFO] openHAB Demp :: App … FAILURE [02:38 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:48 min
[INFO] Finished at: 2019-04-03T14:45:54+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project org.openhab.demo.app: Could not resolve dependencies for project org.openhab.demo:org.openhab.demo.app:jar:2.5.0-SNAPSHOT: The following artifacts could not be resolved: org.openhab.addons.bundles:org.openhab.binding.allplay-tchaikovsky.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.allplay-tchaikovsky-sources.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.leapmotion-LeapJava.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.plclogo-Moka7-1.0.2_io_patch.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.rfxcom-jd2xx.jar:jar:2.5.0-SNAPSHOT, org.openhab.bundles:org.openhab.binding.synopanalyzer:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.tellstick-netty-resolver-2.0.19.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.tellstick-netty-all-4.0.42.Final.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.tellstick-javatellstick-1.1.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.tellstick-async-http-client-netty-utils-2.0.19.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.tellstick-netty-resolver-dns-2.0.19.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.tellstick-async-http-client-2.0.19.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.tellstick-netty-reactive-streams-1.0.8.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.tellstick-reactive-streams-1.0.0.jar:jar:2.5.0-SNAPSHOT: Could not find artifact org.openhab.addons.bundles:org.openhab.binding.allplay-tchaikovsky.jar:jar:2.5.0-SNAPSHOT in openhab-artifactory-snapshot (JFrog) → [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] DependencyResolutionException - Apache Maven - Apache Software Foundation
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :org.openhab.demo.app

Please remove the openhab-addons BOM stuff from your local Maven repo.

Delete the directory

.m2/repository/org/openhab/addons/bom/org.openhab.addons.bom.openhab-addons/2.5.0-SNAPSHOT

that is found relative to your user home.

After that try again.

I’ve done that, but that folder got created again when I called “mvn clean install -U”
This is its content:

again I got some warnings and errors at the end:

[WARNING] The POM for org.openhab.addons.bundles:org.openhab.binding.allplay-tchaikovsky.jar:jar:2.5.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.openhab.addons.bundles:org.openhab.binding.allplay-tchaikovsky-sources.jar:jar:2.5.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.openhab.addons.bundles:org.openhab.binding.leapmotion-LeapJava.jar:jar:2.5.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.openhab.addons.bundles:org.openhab.binding.plclogo-Moka7-1.0.2_io_patch.jar:jar:2.5.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.openhab.addons.bundles:org.openhab.binding.rfxcom-jd2xx.jar:jar:2.5.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.openhab.bundles:org.openhab.binding.synopanalyzer:jar:2.5.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.openhab.addons.bundles:org.openhab.binding.tellstick-netty-resolver-2.0.19.jar:jar:2.5.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.openhab.addons.bundles:org.openhab.binding.tellstick-javatellstick-1.1.jar:jar:2.5.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.openhab.addons.bundles:org.openhab.binding.tellstick-async-http-client-netty-utils-2.0.19.jar:jar:2.5.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.openhab.addons.bundles:org.openhab.binding.tellstick-netty-resolver-dns-2.0.19.jar:jar:2.5.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.openhab.addons.bundles:org.openhab.binding.tellstick-async-http-client-2.0.19.jar:jar:2.5.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.openhab.addons.bundles:org.openhab.binding.tellstick-netty-reactive-streams-1.0.8.jar:jar:2.5.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.openhab.addons.bundles:org.openhab.binding.tellstick-reactive-streams-1.0.0.jar:jar:2.5.0-SNAPSHOT is missing, no dependency information available

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for openHAB Demo 2.5.0-SNAPSHOT:
[INFO]
[INFO] openHAB Demo … SUCCESS [ 0.672 s]
[INFO] openHAB Demp :: App … FAILURE [02:27 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:28 min
[INFO] Finished at: 2019-04-03T15:12:50+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project org.openhab.demo.app: Could not resolve dependencies for project org.openhab.demo:org.openhab.demo.app:jar:2.5.0-SNAPSHOT: The following artifacts could not be resolved: org.openhab.addons.bundles:org.openhab.binding.allplay-tchaikovsky.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.allplay-tchaikovsky-sources.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.leapmotion-LeapJava.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.plclogo-Moka7-1.0.2_io_patch.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.rfxcom-jd2xx.jar:jar:2.5.0-SNAPSHOT, org.openhab.bundles:org.openhab.binding.synopanalyzer:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.tellstick-netty-resolver-2.0.19.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.tellstick-netty-all-4.0.42.Final.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.tellstick-javatellstick-1.1.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.tellstick-async-http-client-netty-utils-2.0.19.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.tellstick-netty-resolver-dns-2.0.19.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.tellstick-async-http-client-2.0.19.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.tellstick-netty-reactive-streams-1.0.8.jar:jar:2.5.0-SNAPSHOT, org.openhab.addons.bundles:org.openhab.binding.tellstick-reactive-streams-1.0.0.jar:jar:2.5.0-SNAPSHOT: Could not find artifact org.openhab.addons.bundles:org.openhab.binding.allplay-tchaikovsky.jar:jar:2.5.0-SNAPSHOT in openhab-artifactory-snapshot (JFrog) → [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] DependencyResolutionException - Apache Maven - Apache Software Foundation
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :org.openhab.demo.app

There is a BOM that references that bundles.
The intention of the removal has been that the BOM is taken from the snapshot repository and no local build is used (so the most recent of https://openhab.jfrog.io/openhab/libs-snapshot/org/openhab/addons/bom/org.openhab.addons.bom.openhab-addons/2.5.0-SNAPSHOT/)
If the BOM is taken from the repository also the dependencies defined in the POM should be available in the repository.

The first missing one is

  • groupId: org.openhab.addons.bundles
  • artifactId: org.openhab.binding.allplay-tchaikovsky.jar

The dependency is declared here: https://openhab.jfrog.io/openhab/libs-snapshot/org/openhab/addons/bundles/org.openhab.binding.allplay/2.5.0-SNAPSHOT/org.openhab.binding.allplay-2.5.0-20190331.091233-6.pom

The files are not found in a Maven repository.

The JAR file itself are not found in a Maven repository.
They are pushed to the local repository while building the respective addon.

As already stated, this is a bad idea.
Your error is an example why we should not use such dependencies (it is similar as using the system scope).

is there a way I or someone can fix this? Maybe there is a workaround?
Should I clone addons and build those that are missing?

It should be fixed by the addons by moving to Maven coordinates for its dependencies.

What you can do as a workaround is to add an exclusions element for the addons bom dependency of the demo that contains an exclude section for every artifact that you listed above.

Unfortunately that will not happen for the mentioned ones. Most jars have been eliminated, but the listed ones are not going in the near future because lack of time :frowning:

A working demo repo for all the other working bundles would still be welcome.

Hm, shouldn’t this one https://github.com/openhab/openhab2-addons/pull/5385 already fix the dependency chain?

1 Like

this PR helped! Thank You very much :smiley:

When I launch localhost:8080 it asks for login/password. Is it correct behavior? IF Yes then what are the correct credentials?

Because the OSGi console is started as main web resource. (The oh dashboard does not exist in this setup and is actually deprecated anyway). You need to go to /paperui or /rest directly.

That makes sense :slight_smile:

For others having the same problem, You must navigate to /paperui/ (slash at end!)
If You don’t add that slash, You will get this as site content:

{{title}} chevron_right {{subtitle}}

1 Like

hi, I am trying to setup Eclipse + maven/bnd to debug the astro project from within Eclipse, as an example for binding dev.
I arrived at the point:

  • openhab2-addons and openhab-demo repos are updated from upstream
  • modified app.bndrun and pom.xml in project openhab-demo to include astro binding
  • compiled successfully with mvn clean install -U both the openhab-demo and the astro projects
  • I can start OH2 (Run OSGi) and PaperUI loads

unfortunately the astro binding does not show up under paperui/configuration/bindings page

What could I check to understand why astro binding is not loaded?

I am in the very same position.
I have add astro in pom.xml
Please try this:
In Tab app / Run, under Browse Repos, search for astro
Paste and copy org.openhab.binding.astro to Run Bundles
In Tab app / Source / look after -runbundles and Edit the line regarding astro as: org.openhab.binding.astro;version=’[2.5.0,2.5.1)’

In Tab app / Run should it be like: org.openhab.binding.astro;version=’[2.5.0,2.5.1)’

Run OSGi

//Basse

1 Like

Some more printouts:
g! smarthome:things list
astro:sun:local (Type=Thing, Status=ONLINE, Label=Astro sun data, Bridge=null)
g!

With the Channel, Position Elevation linked from PaperUI
g! smarthome:links list
Weather_Pressure -> yahooweather:weather:berlin:pressure
Weather_Humidity -> yahooweather:weather:berlin:humidity
MagicDimmer -> magic:dimmable-light:magicDimmer:brightness
Weather_Temperature -> yahooweather:weather:berlin:temperature
MagicOnOff -> magic:onoff-light:magicOnOff:switch
astro_sun_local_position_elevation -> astro:sun:local:position#elevation
MagicColor -> magic:color-light:magicColor:color
g!

//Basse

It worked for me!
Now the astro binding is activated!
Thanks!

I’ve successfully coded my new binding (PCF8574) but I’m unable to test it.
I’ve built my binding using mvn clean install -U


I’ve added binding to Run Requirements and Run Bundles:

but when I run or debug OSGi I get empty http://localhost:8080/paperui/#/configuration/bindings page:

Does anyone know what might be wrong?

Did you check the eclipse console for errors? Did you add the binding to the pom.xml?