Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext maven and Xcore model
Xtext maven and Xcore model [message #1403232] Tue, 22 July 2014 14:31 Go to next message
Jan Rosczak is currently offline Jan RosczakFriend
Messages: 53
Registered: July 2009
Location: Hamburg, Germany
Member
I am using Xtext 2.6 and I have a grammar which uses an Xcore model contained within the same project as the grammar.

Now I want to generate my DSL with Maven and I followed the instructions in the Xtext documentation.

I managed to generate Java classes from my Xcore model and then the generation of the grammar is started, but fails, because the path to my Xcore model is unmapped:

The path '/com.hlag.fit.sql/model/FitSql.xcore' is unmapped


I did try to map it to classpath:, but then I get an error that the src folder under C:\{Path to my JRE\ext is not accessible (which is true, as I am not admin on my PC).

What resource does Xtext try load from this strange location?
Does somebody have a working Maven example with an Xcore model in the same project?

Thanks
Jan
Re: Xtext maven and Xcore model [message #1403446 is a reply to message #1403232] Wed, 23 July 2014 17:31 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1754
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 22/07/2014 16:31, Jan Rosczak wrote:
> I am using Xtext 2.6 and I have a grammar which uses an Xcore model
> contained within the same project as the grammar.
>
> Now I want to generate my DSL with Maven and I followed the instructions
> in the Xtext documentation.
>
> I managed to generate Java classes from my Xcore model and then the
> generation of the grammar is started, but fails, because the path to my
> Xcore model is unmapped:
>
> The path '/com.hlag.fit.sql/model/FitSql.xcore' is unmapped
>
> I did try to map it to classpath:, but then I get an error that the src
> folder under C:\{Path to my JRE\ext is not accessible (which is true, as
> I am not admin on my PC).
>
> What resource does Xtext try load from this strange location?
> Does somebody have a working Maven example with an Xcore model in the
> same project?

Yes :) here it is:

https://github.com/LorenzoBettini/xsemantics/blob/tycho/plugins/it.xsemantics.dsl/pom.xml

but I'm not using the method in the documentation: I use the fornax
plugin to run the mwe2 workflow (also for the Xtext artifacts), so that
I don't have to change the mwe2. In the above pom the first mwe2
generates the emf-gen with Xcore.

Hope this helps
Lorenzo


--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Re: Xtext maven and Xcore model [message #1403578 is a reply to message #1403446] Thu, 24 July 2014 13:39 Go to previous message
Jan Rosczak is currently offline Jan RosczakFriend
Messages: 53
Registered: July 2009
Location: Hamburg, Germany
Member
Yes, it did help a lot. But I also figured out, that for the workflow to work correctly I need the .project file in my project build directory, which I figured was not necessary for the Maven build. But now it works.

Thanks
Jan
Previous Topic:org.eclipse.xtext.parser.impl.PartialParsingHelper - Invalid replace region [0 / length: 30]
Next Topic:XtextDocument Resource empty after getContents()
Goto Forum:
  


Current Time: Mon Dec 09 13:12:20 GMT 2019

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

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

Back to the top