Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XText and maven build with modified Generator
XText and maven build with modified Generator [message #1031937] Tue, 02 April 2013 11:39 Go to next message
Mårten Carlzon is currently offline Mårten CarlzonFriend
Messages: 60
Registered: March 2013
Location: Sweden
Member

Hello folks, first time poster here and wondered if anyone could help me with an issue I have.

I have built a grammar for simplifying a xml-file generation. When the grammar was done I was asked to make a maven build for my project and its here I have some problems.

I made a new project to learn about maven since I havent used it before and I used a project to have something to work with.
(Since its my first post I am not allowed to link outside of the forum, but I used xtext-maven-example 2.3.0 from github by vorburger)

Maven built everything and it seemed fine so I started meddling with the MyDslGenerator.xten to try and make an xml file since that is what I do in my original project and now I am stuck.

I get the following error message:
ERROR:  MyDslGenerator.xtend - C:\...\generator\MyDslGenerator.xtend
13: Couldn't resolve reference to JvmType 'Model'.
31: Couldn't resolve reference to JvmType 'Greeting'.

and so on. I attach the errors for minimizing the size.

So seems to me that it cant find the XText Artifacts for Model and Greeting and I was wondering if anyone might be able to tell me why this happens when I try to meddle with the MyDslGenerator.xtend file?
Everything seems alright in eclipse, don't know if that might be the cause but I built XText Artifacts in eclipse.

Attached files:
MyDslGenerator.xtend to show the modifications I made
errors.txt to show the errors I get when running mvn install

Thanks for any help
Write you later / Mårten
Re: XText and maven build with modified Generator [message #1032064 is a reply to message #1031937] Tue, 02 April 2013 14:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

did you have a look at https://github.com/aphethean/xtext-maven-examples

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XText and maven build with modified Generator [message #1032585 is a reply to message #1032064] Wed, 03 April 2013 07:17 Go to previous messageGo to next message
Mårten Carlzon is currently offline Mårten CarlzonFriend
Messages: 60
Registered: March 2013
Location: Sweden
Member

Hmm... it seems to be the same project I was working from but this has a modified generator and works with maven (although I have 53 errors in eclipse). So seems I did something wrong when I created a new project of my own... well, time to find out what and thanks for the help!

Got two followup questions if thats ok?

I found something interesting when I opened this project.
The folder: org.xtext.example.mydsl.standalone
Was read as: org.eclipse.emf.mwe2.standalone
in eclipse, any reason for that?

And when I try to use the jar file created from this maven build nothing seems to happen, do I need to do something special to use it?
(It seems to have all the files when I open it in 7zip to check its contents)
(Spoled windows used thats used to things happening when I double click on exe and jar files Smile )

Re: XText and maven build with modified Generator [message #1032595 is a reply to message #1032585] Wed, 03 April 2013 07:30 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

you may have a look into the .project file


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XText and maven build with modified Generator [message #1032598 is a reply to message #1032595] Wed, 03 April 2013 07:34 Go to previous messageGo to next message
Mårten Carlzon is currently offline Mårten CarlzonFriend
Messages: 60
Registered: March 2013
Location: Sweden
Member

Ahh, there it was. Well, the name seems to not effect much since the folder still has the right name for the pom files to find all it needs to find.

Any reason for changing the name in the .project file and not have the normal folder name?

And you don't happen to know why nothing happens when I go on a clicking spree on all the jar files generated with the maven build? Smile
Re: XText and maven build with modified Generator [message #1032679 is a reply to message #1032598] Wed, 03 April 2013 09:39 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

i actually tried it (with respect to http://www.eclipse.org/forums/index.php/mv/msg/461666/1022283/#msg_1022283) a while ago and it worked


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XText and maven build with modified Generator [message #1032686 is a reply to message #1032679] Wed, 03 April 2013 09:47 Go to previous message
Mårten Carlzon is currently offline Mårten CarlzonFriend
Messages: 60
Registered: March 2013
Location: Sweden
Member

Hello

*bangs head on table*
Yup, it works, I failed at using the "java -jar ./target/org.xtext.example.mydsl.generator-1.0.0-SNAPSHOT.jar -src ./src/test/mydsl/Example.mydsl -targetdir ./target" command in the command prompt.

So now I have a jar that makes the files I want after a maven build thanks a lot!

Now to make it work on my own project and then to try and make a grafical editor for it... have a feeling I will pop up in here to ask about that as well later but its another subject so should be under another topic.

Thanks for all the help and patience... since everything seems to have been working from the start just me who didn't know how to use the tools I was given.
Thanks again

Write you later / Mårten
Previous Topic:cross reference into other DSL files
Next Topic:Apply a quickfix from java class
Goto Forum:
  


Current Time: Sat Apr 20 03:07:48 GMT 2024

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

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

Back to the top