I have a set of "models" which use libraries to define common parts implemented in Xtext. This works very well.

To allow customers to create their own models, I created a project which contains only the libraries. All my unit tests succeed with this setup. This probably because I resolve resources myself and pass InputStreams to Xtext (not my code )

But when I create a new project, I get errors in the DSL editors even after adding the library project to the build path as a "required project".

My guess is that this is because the library is references with "lib base;" in the DSL but the actual file is in the package "com.pany.product.config.dsl.libs".

I think I need to implement a IContainer.Manager which takes a set of paths and tries to locate the library name in those paths. I looked at ResourceSetBasedAllContainersState which seems almost like what I need but how do I configure it?

From the code in ResourceSetBasedAllContainersStateProvider, the container2Uris Multimap translates container names to a set of URIs.

How do I map the library name "base" to the URI "classpath:/com/pany/product/config/dsl/libs/base.lib"? Or is the ResourceSetBasedAllContainersState smart enough to do that for me? Or am I on the wrong track here? All I want is a static mapping from library name to URI.

As I said, my approach is "search path based". The resources are in a certain package on the classpath. It works when the resources are in the same project but I get errors in the editor when I move them to a different project (even though they are still in the same place on the classpath).

Remember that there are two modes of operation: Product and Eclipse editor. The product is web based, so no Eclipse/OSGi/p2 is involved.

Product mode: I have a configuration which lists all packages where resources can be found. At startup, I read the config and create a "DSL loader" which searches and loads all configured libraries in a shared resource. Scripts are then loaded into the same resource. Since the libraries are already present, the proxy resolver has no problem to find them.

Eclipse editor mode: Within the editor, something else happens. My guess is that the JavaProjectsState class is somehow involved but the code is hard to understand - this is one of the drawbacks of DI: If you don't know which part of the code contains a certain functionality, you're lost since you can't easily figure it out by looking the code.

What I don't understand is why it works when the resources are in the same project but why it fails when I split the resources over several projects. In the JavaProjectsState class, I see WorkspaceProjectsStateHelper and JavaProjectsStateHelper which suggests that the Xtext runtime can resolve resources via the classpath but for some reason, this isn't happening.

One odd thing that I noticed: There is no "Referenced Libraries" node in the Package Explorer :-/ Makes me wonder if I'm missing a plug-in when I start an Eclipse Application via "Run...".

PS: The errors suddenly vanished. I cleaned the configuration, the workspace and built the plug-ins once more. No idea which of the three fixed the problem. Is there a way to debug the resource resolution?