Eclipse - can't resolve: org.eclipse.equinox.metatype not found

I’m trying to run debugging in Eclipse, and once again, ‘resolving’ fails. This time the culprit allegedly is org.eclipse.equinox.metatype.

I tried searching the forum for help, but didn’t seem to find anything on the topic.

Does anyone have an idea? I’ve pulled both the core as the addons repository, so all is up to date.

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:

Powershell:

mvn clean install --% -nsu -T1C -DskipTests -DskipChecks -Dspotless.check.skip=true -Dmarkdownlint.skip=true

Non-Powershell:

mvn clean install -nsu -T1C -DskipTests -DskipChecks -Dspotless.check.skip=true -Dmarkdownlint.skip=true

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:

Disabling “Offline” in the “Maven Update” step seemed to do the trick!

Thanks for writing this all down (again)! I bookmarked it :wink:

Also for future reference about getting the correct Bnd Tools version: