Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Standalone generator & models in multiple jars(Referencing models in separate jars)
Standalone generator & models in multiple jars [message #1061937] Wed, 05 June 2013 00:38 Go to next message
Karel Alfonso is currently offline Karel AlfonsoFriend
Messages: 1
Registered: June 2013
Junior Member

I have two projects both containing files for a DSL I've designed. I'm using maven and have declared the dependency as required. The base project packages the DSL files inside the jar artifact that gets generated.

I get an error when invoking from maven and I try to load a DSL file that references elements that are in the jar file of the project dependency.

I'm using the code below:

Provider<XtextResourceSet> resourceSetProvider


XtextResourceSet resourceSet = resourceSetProvider.get();
resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE);

// Iterate through all the files in a configured directory and add to resource
URI uri = URI.createURI(file.getPath());
resourceSet.getResource(uri, true);

I thought that by setting OPTION_RESOLVE_ALL Xtext will index the classpath to find the DSL resources.

So, if I don't know the name of the jar files in advance, is there a way to tell Xtext to scan the classpath and find the DSL resources? Eclipse does it in a way as I'm able to navigate from a DSL file in one project to another project even with "workspace resolution" disabled.

Any help will be appreciated.

Thanks, Karel
Re: Standalone generator & models in multiple jars [message #1061950 is a reply to message #1061937] Wed, 05 June 2013 06:11 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12045
Registered: July 2009
Senior Member

you have to scan for resources and load them to the resourceset yourself.
this is intended.

you may use org.eclipse.xtext.mwe.Reader
instead of doing the resource handling yourself

Need professional support for Xtext, Xpand, EMF?
Go to:
Twitter : @chrdietrich
Blog :
Previous Topic:[XBase] Find JvmType for specific class name?
Next Topic:Using Xbase in a Papyrus popup editor
Goto Forum:

Current Time: Mon Jun 25 20:03:21 GMT 2018

Powered by FUDForum. Page generated in 0.01922 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top