Unresolved artifacts

I have a custom binding that I created and is working in openHAB 3.1. I have performed these stepps:

  1. cloned the openHAB 3.2 addons
  2. dropped my binding into the bundles directory
  3. added it to the pom.xml file
  4. Changed my pom.xml from 3.1.2-SNAPSHOT to 3.2.0

(nothing else was changed)

When execute the the command: mvn clean install -pl :org.openhab.binding.ccaedio

I get the following output:

C:\openhab-addons-3.2.0>mvn clean install -pl :org.openhab.binding.ccaedio
[INFO] Scanning for projects...
[INFO]
[INFO] -------< org.openhab.addons.bundles:org.openhab.binding.ccaedio >-------
[INFO] Building openHAB Add-ons :: Bundles :: CCAEdio Binding 3.2.0
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.openhab.core.bom:org.openhab.core.bom.compile:pom:3.2.0 is missing, no dependency information available
[WARNING] The POM for org.openhab.core.bom:org.openhab.core.bom.test:pom:3.2.0 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  12.206 s
[INFO] Finished at: 2021-12-20T19:28:11-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project org.openhab.binding.ccaedio: Could not resolve dependencies for project org.openhab.addons.bundles:org.openhab.binding.ccaedio:jar:3.2.0: The following artifacts could not be resolved: org.openhab.core.bom:org.openhab.core.bom.compile:pom:3.2.0, org.openhab.core.bom:org.openhab.core.bom.test:pom:3.2.0: org.openhab.core.bom:org.openhab.core.bom.compile:pom:3.2.0 was not found in https://wolfecomputerservices.jfrog.io/artifactory/default-maven-virtual during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced -> [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

Of course all references to org.openhab.core are marked as errors as the package can’t be found. Is there something I missed to change when migrating from 3.1 to 3.2? Is there a developer document showing migration steps?

The easiest way would probably be to rebase your branch on the latest openhab-addons/main. Then you just have to update the version in your bindings pom-file.

Edit: which IDE are you using?

I didn’t want all the other bindings in my repository so I didn’t form from there. I have my own branch and not “tied” to the openHAB branches. I’m not a git expert but that was the only way to keep the rest of the bindings from being included in my repository; please correct me if there is a better way. Therefor, rebasing would just rebase on my repository; correct?

Visual Studio Code.

What’s the problem with having the other bindings? It’s not like it takes a huge amount of space. Plus, if you have deleted all the other bindings it will probably create issues if you do a PR with your binding (the PR will include the deletion of all other bindings).

Not sure what maven tools are available there, but at least in IntelliJ you can ask to reload changes in the pom files which updates the dependencies. There is probably a cli command for that as well, but I’m not sure what it is or how to use it. You would save yourself some trouble if you just pull openhab-addons/main (into a new directory), copy your binding there and add it to the bom/openhab-addons/pom.xml and bundles/pom.xml files.

Okay, I thik I misunderstood what you were suggesting. I have in fact the entire openhab-addons directory on my computer and copied my 3.1.2 binding code to the bundles directory (see steps 1-4 in my original post). I just don’t keep them all in my git repository.

I can’t see that happening anyway. It is a very limited audience (only Pennsylvania residents with students enrolled in Commonwealth Charter Academy). I did it mainly for my own use.

Added it to the bundles/pom.xml file: <module>org.openhab.binding.ccaedio</module>

But, how do you add it to the bom/pom.xml file? I didn’t do that for 3.1, is that a new thing? Where do I add it; I don’t see any other binding there?

It’s done automatically by the create skeleton script, but to do it manually, just copy one of the entries for another binding and change the <artifactId> to match yours.

But if you have the complete repository, i would guess that the problem is with resolving dependencies. I’ve had issues with that sometimes as well, and had to delete the %USERPROFILE%\.m2-folder to force redownload of all dependencies.

I was looking at the wrong file. I was looking at bom/pom.xml not bom/openhab-addons/pom.xml. I copy an entry for my binding and I get the same results. I even searched the entire /openhab-addons-3.2.0 structure for another binding name and only found that one place (beyond the binding itself); therefore, I now have all the changes for sure.

Did a couple times previously. However, I just did it again and ran mvn clean install -pl :org.onpenhab.binding.ccaedio from the \openhab-addons-3.2.0 directory. It now builds

So, openhab 3.1 and 3.2 bindings can’t be developed on the same machine without reloading the dependencies when switching from one to the other? Is there a document that explains how to migrate an existing binding to a new version; like the stuff I had to do here?

Since the dependencies are different between the different versions (mainly oh-core) they have to be resynced when switching. I know that IntelliJ handles this automatically (but can take a while to reload the whole maven project), except for sometimes where I’ve had to clear the .m2 directory. Not sure how it can be done via cli or vscode though.

Your original error indicated the core libraries could not be found. Given your steps of adding your binding to the original repository tree, it might be the core libraries were not available in a global maven repository at that moment. Try running maven with -U to check if they are available now. Updating the pom.xml version information should normally just work.

They have been and I can see them in the cache now too.