PS! Read the last edit first, there’s no point in wasting time on this if you’re running the wrong version of Bndtools.
Don’t mind the error itself, they rarely point to something of interest.
The most important thing is to make sure that “everything is up-to-date” before you try to resolve:
Close the “demo.app” window.
Right-click the org.openhab.demo.app project in “Project Explorer” → Maven → Update Project. Normally, you want to do this in “offline” mode so that it doesn’t pull down artifacts that might not be compatible with your local environment, but when you haven’t gotten it to run first at all, you might actually be missing artifact, so don’t select “offline” the first time you do it. Let it finish all tasks before continuing.
Double-click app.bndrun in the same project. The “Demo app” window appears again. Pay attention to the “tasks” in the lower right corner, and don’t do anything until it’s done “Creating implicit repo”.
Once it’s done and does nothing, click the “Resolve” button. Then click “Update”, and once you get back to the “Demo app” window, save. Eclipse might hang for a while when you save, depending on many projects you have open. I have a lot open, so this takes exactly 19 minutes for me. Once that freezing/partial hanging is over, it will do another “Creating implicit repo”. Let it finish.
Once it’s done with all tasks again, click “Debug OSGi”. Voilà.
If it refuses to resolve when you follow these steps, I typically build core in its entirety. First, turn off Project → Build Automatically so that Eclipse doesn’t get a heart attack while you build. Then open a console in the root folder of openhab-core, and run:
It will take some 10 minutes or so. Once it’s done, navigate to “OH Core” in “Project Explorer”, right-click it and select “Refresh”. Wait for it to finish, and then reenable Project → Build Automatically.
Watch a movie while it figures everything out and builds things east and west. Once it’s done, start at the second point in the list above with Maven → Update Project and follow the steps. Now it should resolve.
edit: All of this is futile if you’re not running version 7.0.0 of “Bndtools”, the later versions are broken:
Thank you for this. I was incessantly getting an error in the “Problems” tab indicating that my local binding file, org.openhab.binding.blink.5.3.0-SNAPSHOT.jar could not be found in the online repository jfrog.io. I must have yelled a billion times at eclipse "NO S#!T, it’s right there in my target directory!
But for whatever reason, building the project doesn’t actually “update the project” before building the project. Anyway, you helped me, so thank you!
Eclipse take a LOT of time to operate the bnd plugin. As Nadahar said, it can easily take more than 10 minutes when saving/updating the bnd file.
The page I linked exposes a way to resolve / run / debug the demo project, including addons. It uses the maven bnd plugin, instead of the bnd plugin bundled with eclipse.
By using this solution, we don’t have to wait 10+ minutes for eclipse to do… I don’t know what, but whatever.
Building is done without recalculating the Maven dependencies (to save time I’m sure), so to have it recalculate/re-resolve the dependency graph, you must use “Maven → Update Project”. It might be a bit weird, but I’m glad it’s done that way, or building would take an absolute eternity.
In my experience, this doesn’t always work, and it will trigger an even longer pause when Eclipse “discovers” that the .bndrun file has changed. So, if you’re having success running success doing it this way and still running it from within Eclipse (with debugger support etc.), I’m a bit confused, because that’s not my experience.
All that said, @wborn has made a contribution to Bndtools that should be in the latest snapshots/perhaps milestone, that shows a lot of promise to actually solve the whole problem using the latest version of Bndtools from what I could see in the code. The latest version might not have the same “slowness issues” (that’s just a guess/hope from my side, but still worth checking), so if anybody feels brave, installing a very recent Bndtools snapshot/milestone might be a solution to a lot of this mess.
I haven’t been able to do it because the latest version of Bndtools is incompatible with my whole Eclipse installation, because I simply don’t upgrade a working installation - since I think life is to short to fight with Eclipse for potentially days to get things running again. But, for those of you that’s already running a more recent version of Eclipse, that might not be an issue.
I made the assumptions that eclipse user can disable the bnd plugin. If not, then, my bad and the generic solution is not a good fit for Eclipse.
(After more than a decade with Eclipse, I switched to another IDE)
If you disable/uninstall the bnd plugin/bndtools, you disable the whole integration that makes it valuable to use Eclipse. It means that you can’t run it from Eclipse, it can’t hot-replace code, the logging isn’t integrated, and the debugger isn’t integrated so that you can halt the code at any point you want to, inspect “everything” or evaluate expressions in the context of a method.