Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build project because of missing nthbnd dependency #10102

Closed
FatalCatharsis opened this issue Feb 8, 2021 · 12 comments
Closed

Cannot build project because of missing nthbnd dependency #10102

FatalCatharsis opened this issue Feb 8, 2021 · 12 comments
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@FatalCatharsis
Copy link

Expected Behavior

Based on the documentation here, I should be able to fork the project and mvn clean install at root, have it complete successfully, and have a jar available to drop into the openhab addons directory.

Current Behavior

When I attempt to clean install, one of the dependencies for openHAB Add-ons :: BOM :: Test Index 3.1.0-SNAPSHOT cannot be found.

The attempt to fetch is here:

[INFO] ------< org.openhab.addons.bom:org.openhab.addons.bom.test-index >------
[INFO] Building openHAB Add-ons :: BOM :: Test Index 3.1.0-SNAPSHOT     [4/343]
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from openhab-snapshot: https://openhab.jfrog.io/openhab/libs-snapshot/org/eclipse/sensinact/gateway/nthbnd/parent/1.5-SNAPSHOT/maven-metadata.xml
Downloading from openhab-snapshot: https://openhab.jfrog.io/openhab/libs-snapshot/org/eclipse/sensinact/gateway/nthbnd/parent/1.5-SNAPSHOT/parent-1.5-SNAPSHOT.pom

And the failure result is here:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  28.883 s
[INFO] Finished at: 2021-02-08T03:02:55-06:00
[INFO] ------------------------------------------------------------------------
[INFO] Static code analysis summary report is available in:
[INFO] file:/F:/Documents/Projects/contributing/openhab-addons/target/summary_report.html
[ERROR] Failed to execute goal on project org.openhab.addons.bom.test-index: Could not resolve dependencies for project org.openhab.addons.bom:org.openhab.addons.bom.test-index:jar:3.1.0-SNAPSHOT: Failed to collect dependencies at org.openhab.core.bom:org.openhab.core.bom.test:pom:3.1.0-SNAPSHOT -> com.jayway.jsonpath:json-path:jar:2.4.0: Failed to read artifact descriptor for com.jayway.jsonpath:json-path:jar:2.4.0: Could not find artifact org.eclipse.sensinact.gateway.nthbnd:parent:pom:1.5-SNAPSHOT in openhab-snapshot (https://openhab.jfrog.io/openhab/libs-snapshot) -> [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] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :org.openhab.addons.bom.test-index

Process finished with exit code 1

Steps to Reproduce (for Bugs)

  1. Fork the project, in my case here
  2. Clone the project
  3. Open in intellij
  4. Run mvn clean and then install on "openHAB Add-ons" (root)

Context

I was hoping to start writing a binding for a raspberry pi project I'm working on, but I could not get the project to build.

Your Environment

Cloned from commit b65e932.
Intellij 3.2
OpenJDK 11.0.10+9 Zulu: 11.45.27
Windows 10

@FatalCatharsis FatalCatharsis added the bug An unexpected problem or unintended behavior of an add-on label Feb 8, 2021
@Hilbrand
Copy link
Member

Hilbrand commented Feb 9, 2021

I was hoping to start writing a binding for a raspberry pi project I'm working on, but I could not get the project to build.

There is absolutely no reason to build the whole repository to just create a binding. The repository contains a large number of bindings that all are unrelated to each other or needed for your new binding. If you build the repo to start developing a binding you're wasting your time.

To start developing a binding start with the skeleton script and just build only your own binding. Both steps are described in the documentation.

@yfre
Copy link
Contributor

yfre commented Feb 9, 2021

same here. im trying to build homekit addon only and it was working before.
the only changes i did

  • i have removed my local repository in .m2/repository
  • pull latest changes from main branch

log:
...
Downloaded from openhab-release: https://openhab.jfrog.io/openhab/libs-release/org/apache/karaf/features/standard/4.2.7/standard-4.2.7.pom (18 kB at 11 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:19 min
[INFO] Finished at: 2021-02-09T09:13:13+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project org.openhab.io.homekit: Could not resolve dependencies for project org.openhab.addons.bundles:org.openhab.io.homekit:jar:3.1.0-SNAPSHOT: Failed to collect dependencies at org.openhab.core.bom:org.openhab.core.bom.openhab-core:pom:3.1.0-SNAPSHOT -> org.openhab.core.bundles:org.openhab.core.test:jar:3.1.0-SNAPSHOT -> org.openhab.core.bom:org.openhab.core.bom.test:pom:3.1.0-SNAPSHOT -> com.jayway.jsonpath:json-path:jar:2.4.0: Failed to read artifact descriptor for com.jayway.jsonpath:json-path:jar:2.4.0: Could not find artifact org.eclipse.sensinact.gateway.nthbnd:parent:pom:1.5-SNAPSHOT in openhab-snapshot (https://openhab.jfrog.io/openhab/libs-snapshot) -> [Help 1]
[ERROR]

@Hilbrand
Copy link
Member

Hilbrand commented Feb 9, 2021

There was a post on the forum about this that got wiped out due to the outrage unfortunately. It seems there is a botched version of the library in an eclipse maven repository (I don't know where it was. It was linked on the forum). The solution was to manually remove the json-path jar file from your local m2 repository and replace it a version from maven central. (I don't remember the exact instructions, but probably something like this to install the file in your local maven repository with mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile=json-path-2.4.0.jar

@yfre
Copy link
Contributor

yfre commented Feb 9, 2021

@Hilbrand thank you. this fixed it.

i download both, jar and pom, from the link you have provided and installed it locally with

mvn install:install-file -Dfile=json-path-2.4.0.jar -DpomFile=json-path-2.4.0.pom

@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/error-running-create-openhab-binding-skeleton-cmd/116633/2

@aarondvail
Copy link

So I manually downloaded json-path-2.4.0.jar and json-path-2.4.0.pom and I ran the command:
mvn install:install-file -Dfile=json-path-2.4.0.jar -DpomFile=json-path-2.4.0.pom

then I reran:
create_openhab_binding_skeleton.cmd mqttitude "Author" aarondvail

and now I get:
Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.0.3:check (codestyle_check) on project org.openhab.addons.reactor.bundles

@Hilbrand
Copy link
Member

and now I get:
Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.0.3:check (codestyle_check) on project org.openhab.addons.reactor.bundles

I suspect you're not talking about the output or the skeleton script here. So it's a bit guessing what your are trying to do here. Anyway. The skeleton generated code is just a template and may not be fully up-to-date. We now run spotless to format the code, and spotless is also run as check and when if finds issues your build fails. So in general you should run mvn spotless:apply before running a build with maven (you can run it at the same time: mvn spotless:apply install).

Note 1: Since you're on windows, make sure your binding is in the bundles/pom.xml I know there are some issues with the skeleton on windows and sometimes it doesn't add your binding to that pom.xml.
Note 2: Am I correct this is a mqtt related binding? If that is the case I would expect it to be part of the existing mqtt binding. This has some implications to structure; something like org.openhab.binding.mqtt.mqttitude (?) and that it is build on using existing mqtt binding features. But this is just wild guessing from my part here. If you have questions about that the forum is a better place to discuss/ask.

@aarondvail
Copy link

mvn spotless:apply install fixed it Thanks!

@schinken
Copy link
Contributor

It's my first time trying to develop for openhab, and I also got this error:

[ERROR] Failed to execute goal on project org.openhab.addons.bom.test-index: Could not resolve dependencies for project org.openhab.addons.bom:org.openhab.addons.bom.test-index:jar:3.1.0-SNAPSHOT: Failed to collect dependencies at org.openhab.core.bom:org.openhab.core.bom.test:pom:3.1.0-SNAPSHOT -> com.jayway.jsonpath:json-path:jar:2.4.0: Failed to read artifact descriptor for com.jayway.jsonpath:json-path:jar:2.4.0: Failure to find org.eclipse.sensinact.gateway.nthbnd:parent:pom:1.5-SNAPSHOT in https://openhab.jfrog.io/openhab/libs-snapshot was cached in the local repository, resolution will not be reattempted until the update interval of openhab-snapshot has elapsed or updates are forced -> [Help 1]

But mvn spotless:apply install did not fix anything. Is this a new (temporary) problem? I just followed straight the development guide

@Hilbrand
Copy link
Member

@schinken. If you followed instructions you need to follow the right once 😀see the comment above: #10102 (comment) That is about your specific error. The spotless apply is totally unrelated to the topic of the issue (and also why people should not post other problems in an issue)

@schinken
Copy link
Contributor

@Hilbrand Thank you so much! BUILD SUCCESS!
This worked out (#10102 (comment)) after downloading these two files from https://mvnrepository.com/artifact/com.jayway.jsonpath/json-path/2.4.0

@lolodomo
Copy link
Contributor

lolodomo commented Aug 8, 2021

This can be closed now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

No branches or pull requests

8 participants