Errors occurred during build and Import

My project is using bndtools 7.0.0 and I hit the following errors everytime I try to import the project (using either Import Existing Projects or Existing Bndtools Workspace) or doing a full rebuild in Eclipse:

Errors occurred during the build.
Attempted to beginRule: MultiRule, does not match outer scope rule: R/

If I just ignore the errors, it does works fine in Eclipse after that. The project also build without any errors with ./gradlew build

Works fine in intellij 2024.2 too with amdatu plugin (using a custom build that support bndtools 7.0.0 - hengsin / amdatu-idea / Downloads — Bitbucket).

What shall I check here to get rid of the errors?

Thanks.

This seems to be unrelated to bndtools.
When I google this I find Eclipse / EGit related bugs e.g. 536472 – IAE: Attempted to beginRule: R/, does not match outer scope rule: ... in SquashCommitsOperation

It seems to be caused by build. Below is the exception trace after Project > Clean All…

java.lang.IllegalArgumentException: Attempted to beginRule: MultiRule[], does not match outer scope rule: R/
	at org.eclipse.core.runtime.Assert.isLegal(Assert.java:68)
	at org.eclipse.core.internal.jobs.ThreadJob.illegalPush(ThreadJob.java:144)
	at org.eclipse.core.internal.jobs.ThreadJob.push(ThreadJob.java:416)
	at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:66)
	at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:343)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:289)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:352)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:441)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:444)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:555)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:503)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:585)
	at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:595)
	at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:484)
	at org.eclipse.ui.internal.ide.dialogs.CleanDialog.doClean(CleanDialog.java:355)
	at org.eclipse.ui.internal.ide.dialogs.CleanDialog$1.runInWorkspace(CleanDialog.java:159)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

The stacktrace contains only Eclipse classes, nothing with bnd.
If bnd / bndtools would be involved then you should see bnd somewhere.

e.g. aQute.bnd.XXXX or bndtools.XXXX

Or this is not the full stack trace.

here is another open Github issue , where others seem to have the same problem.

This seems closest - Attempted to beginRule: MultiRule[], does not match outer scope rule: R/ · Issue #376 · eclipse-platform/eclipse.platform · GitHub and it say it is due to custom builder.

Probably org.eclipse.core.resources.IncrementalProjectBuilder.getRule(int, Map<String, String>) not properly implemented · Issue #535 · eclipse-pde/eclipse.pde · GitHub , perhaps for some reason the pde builder is still active. This is migrated from pde build and perhaps I’ve not clean up all pde stuffs.

Update: it is indeed cause by this pde bug. The workaround mention in the ticket (create a dummy pde project) works to remove the build error.

2 Likes