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 resolve bundle from bndrun file in M2E project: Cannot find framework #6393

Closed
sad-poet opened this issue Dec 7, 2024 · 4 comments · Fixed by #6401
Closed

Cannot resolve bundle from bndrun file in M2E project: Cannot find framework #6393

sad-poet opened this issue Dec 7, 2024 · 4 comments · Fixed by #6401

Comments

@sad-poet
Copy link

sad-poet commented Dec 7, 2024

Using the latest Bndtools snapshot in a M2E workspace, attempting to resolve a .bndrun file from the Eclipse IDE results in an error.

When trying to resolve the same file with Bndtools 7.1.0, a different error appears, as described in #6380.

This is a regression from Bndtools version 7.0.0, where everything works as expected.

Steps to reproduce

I have prepared a reproducer Maven project that builds a minimal bundle using bnd-maven-plugin. The project contains a run.bndrun file that runs this bundle with Equinox, as well as debug.bndrun file that includes run.bndrun and adds Apache Felix Gogo console. The POM is configured to export executable JAR using bnd-export-maven-plugin.

  1. Launch Eclipse IDE 2024-12 with Bndtools version 7.2.0.DEV-202412050913-g8c79789 (installed from https://bndtools.jfrog.io/bndtools/update-snapshot without Bndtools PDE integration).
  2. Import the reproducer project from the archive: bndtools-resolve-reproducer.tar.gz
  3. Open run.bndrun in Bnd Run File Editor and choose Run tab in the bottom of the editor.
  4. Click Resolve button.

Actual result

The following error message is displayed in the Resolution Results window:

Resolution failed. Summary:
      ⇒ Bundle: org.example.bndtools.bndrun.reproducer cannot be resolved

Note: The summary above may be incomplete. Please check the full output below for more hints.
Resolution failed. Capabilities satisfying the following requirements could not be found:

    [<<INITIAL>>]
      ⇒ osgi.identity: (osgi.identity=org.example.bndtools.bndrun.reproducer)

resolvedebug log: INFO: Using framework org.eclipse.osgi;3.21.0
ERROR: Cannot find framework org.eclipse.osgi;3.21.0
DEBUG: for osgi.identity;filter:='(osgi.identity=org.example.bndtools.bndrun.reproducer)' found []
DEBUG: for osgi.identity;filter:='(osgi.identity=org.example.bndtools.bndrun.reproducer)' found []

Bndtools version 7.0.0 can resolve the file correctly. bnd-resolver-maven-plugin v7.1.0 configured in the POM also works as expected (mvn bnd-indexer:index bnd-resolver:resolve).

Expected result

There should be no error. A Resolution Results window should open, displaying the required resources used to create the Run Bundles list, which must contain exactly one bundle built from the project itself:

-runbundles: org.example.bndtools.bndrun.reproducer;version='[1.0.0,1.0.1)'
@sad-poet sad-poet changed the title Cannot resolve bundle from same project as the bndrun file: Cannot find framework Cannot resolve bundle from bndrun file in M2E project: Cannot find framework Dec 7, 2024
@chrisrueger
Copy link
Contributor

chrisrueger commented Dec 8, 2024

Thanks for the report and for the reproducer. I could reproduce it.

I have the feeling the bndrun cannot see the repositories, and thus cannot resolve the bundles.
image

biz.aQute.resolve.BndrunResolveContext.getAllRepos() also returns an empty list, because the single EclipseWorkspaceRespository (returned by project.getWorkspace()getPlugins(Repository.class, Constants.REPOTAGS_RESOLVE) ) is filtered out. So the 2 Maven Repositories which are shown in the Repository Browser are not seen by the bndrun resolver (bndtools.m2e.MavenDependenciesRepository, bndtools.m2e.MavenWorkspaceRepository).

@pkriens I have no clue at the moment, but maybe the BndEditModel rework somehow is missing something so that the 2 Maven Repositories are not seen. Maybe because it is not a Bnd cnf Workspace.

In a quick debug session I noticed that a default workspace instance is created. Not sure this is helpful
image

Not sure, maybe this default workspace is behaving different.

@sad-poet Could you maybe check which repositories you see in the Bnd Run Editor (first screenshot, upper red arrow) with Bnd 7.0.0?

I have the feeling your other issues (#6394 , #6395 ) are related.

@sad-poet
Copy link
Author

sad-poet commented Dec 8, 2024

@chrisrueger, here is how Bnd Run File Editor looks like for me:

  • with Bndtools 7.0.0 release:
    bndtools-GH6393-v7 0 0
  • with Bndtools 7.2.0.DEV-202412050913-g8c79789 snapshot:
    bndtools-GH6393-v7 2 0 DEV-202412050913-g8c79789

@chrisrueger
Copy link
Contributor

chrisrueger commented Dec 8, 2024

Thanks @sad-poet I have created PR #6396 which could fix this. But need some feedback from @pkriens next days.

@chrisrueger
Copy link
Contributor

Quick update @sad-poet : I had a chat with @pkriens and we think all your 3 issues #6393 , #6394, #6395 have the same root cause and we will try to fix them. This will probably lead to a Bugfix 7.1.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants