Skip to content

Bnd Run File Editor: “Resolve” button stopped working in Maven workspaces since Bndtools 7.1.0 #6380

@sad-poet

Description

@sad-poet

Starting with Bndtools 7.1.0, opening a *.bndrun file in a Maven-only workspace and clicking the Resolve button results in a NullPointerException (see below).

The problem is not reproduced when using Bndtools 7.0.0.

Environment

  • Bndtools 7.1.0.202411251545 (installed from https://bndtools.org/bndtools.p2.repo/7.1.0/)
    • Git-Descriptor: 7.0.0.DEV-1660-g47e504d78
    • Git-SHA: 47e504d7881ba466703c55a8dca7b0578561582d
  • Eclipse Temurin JDK 21.0.5
  • Eclipse IDE for Java Developers 2024-09
  • Eclipse Java Development Tools 3.19.600.v20240903-0240
  • Eclipse PDE is not installed
  • Apache Maven 3.9.9
  • bnd-maven-plugin 7.1.0
  • Devuan GNU+Linux codename Ceres (corresponding to Debian sid/unstable)

It was also possible to reproduce the error using Eclipse 2024-12 preview version, and on Windows 11.

Steps to reproduce

  1. Install Eclipse IDE (from Eclipse Installer) and latest Bndtools (from Eclipse Marketplace Client), including Bndtools m2e integration feature.
  2. Clone the example project and open it in Eclipse IDE: https://github.com/sad-poet/bndtools-resolve-npe-reproducer
  3. Open app/app.bndrun file in Bnd Run File Editor.
  4. Click Resolve button.

Expected result

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

Actual result

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

Exception during resolution.
java.lang.NullPointerException: Cannot invoke "aQute.bnd.build.Project.get(String)" because "project" is null
	at biz.aQute.resolve.RunResolution.resolve(RunResolution.java:101)
	at org.bndtools.core.resolve.ResolveOperation.lambda$run$0(ResolveOperation.java:62)
	at org.bndtools.core.resolve.ResolveOperation.coordinate(ResolveOperation.java:102)
	at org.bndtools.core.resolve.ResolveOperation.run(ResolveOperation.java:52)
	at org.bndtools.core.resolve.ResolveJob.run(ResolveJob.java:89)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

screenshot

No new errors appear in the Eclipse’s Error Log view.

The problem persists in all Maven projects that use bnd-maven-plugin. I was also able to reproduce the error when trying to resolve the app/app.bndrun file in a different example project found at https://github.com/fipro78/osgi-jakartars/tree/main/jakartars.

Workaround

If bnd-resolver-maven-plugin is set up, the command line mvn bnd-resolver:resolve can be used and works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions