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

Resolver in Eclipse M2E workspace ignores -runrequires from included bndrun file #6395

Closed
sad-poet opened this issue Dec 7, 2024 · 2 comments

Comments

@sad-poet
Copy link

sad-poet commented Dec 7, 2024

Using the latest Bndtools snapshot version in an M2E workspace, the Bnd Run File Editor’s resolver will not take into account the -runrequires directives from bndrun files that are -included into the active file. Resolution would produce an incomplete list of -runbundles that does not contain bundles required from the included bndrun file.

This is a regression from Bndtools 7.0.0 where resolution in M2E projects worked correctly.

Project setup

This is the same reproducer Maven project as in my previous reports #6393 and #6394. There I have prepared a reproducer Maven project that builds a minimal Hello World bundle using Bnd Maven Plugins. The project contains a run.bndrun file that runs the bundle with the Eclipse Equinox OSGi framework and debug.bndrun file that includes run.bndrun and adds the Apache Felix Gogo console for debugging. There are no dependencies other than Equinox and Gogo.

Resolving debug.bndrun from the IDE currently produces an error related to -runfw and -runee (#6394). To demonstrate the problem with -runbundles, I made a modified version of the file called debug-standalone.bndrun, which is used below.

Steps to reproduce

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

Actual result

A Resolution Results window opens, displaying a resolution that is not valid. The list of required bundles includes only the Gogo shell bundles required directly from debug-standalone.bndrun, but does not include the project’s own bundle which is required transitively from -include run.bndrun.

The application will not work as expected if run , and mvn bnd-resolver:verify will report an incorrect resolution.

Expected result

There should be no error. A Resolution Results window should open, displaying the required resources used to create the Run Bundles list.

The resulting -runbundles list should include the project’ own bundle and Gogo shell bundles and look like the following:

-runbundles: \
	org.apache.felix.gogo.command;version='[1.1.2,1.1.3)',\
	org.apache.felix.gogo.runtime;version='[1.1.6,1.1.7)',\
	org.apache.felix.gogo.shell;version='[1.1.4,1.1.5)',\
	org.example.bndtools.bndrun.reproducer;version='[1.0.0,1.0.1)'

The command line mvn bnd-indexer:index bnd-resolver:resolve can process the bndrun file correctly and render exactly the above expected result. (The POM is configured to use Bnd Maven plugins version 7.1.0).

Bndtools 7.0.0 can also resolve this file in the Eclipse IDE correctly.

@chrisrueger
Copy link
Contributor

I think this has the same root cause as #6394

@pkriens
Copy link
Member

pkriens commented Dec 13, 2024

This should be fixed, please reopen if there are still issues.

@pkriens pkriens closed this as completed Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants