Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Solved] Post processing in standalone maven project(Couldn't resolve reference to JvmType)
icon5.gif  [Solved] Post processing in standalone maven project [message #1233722] Mon, 20 January 2014 10:33 Go to next message
Xi Lin is currently offline Xi LinFriend
Messages: 21
Registered: January 2014
Junior Member
I'm trying to build a maven based DSL project with Xtext using the guide www.eclipse.org/Xtext/documentation.html#continuousIntegration.

And in order to add some functions and attributions in generated EMF objects, i use the post processing methods described in christiandietrich.wordpress.com/2011/07/22/customizing-xtext-metamodel-inference-using-xtend2.

Everything is OK in eclipse. But when i switch to maven running "mvn clean install" i get error messages as follow:
[org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - [XtextLinkingDiagnostic: null:53 Couldn't resolve reference to JvmType 'ExtendedGenerator'.,


Where ExtendedGenerator is a java class extending original Xtext Generator and replacing component definition in the mwe2 file, and placed in the same directory with mwe2 file.

Do we need to add it to classpath? And since the Mwe2Launcher is invoked by exec-maven-plugin in generate-sources phase before the compile phase, will our ExtendedGenerator.java be saw in that phase?

Thanks.

[Updated on: Wed, 22 January 2014 03:52]

Report message to a moderator

Re: Post processing in standalone maven project [message #1233842 is a reply to message #1233722] Mon, 20 January 2014 16:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi you have to move the code to a separate maven module

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Post processing in standalone maven project [message #1234058 is a reply to message #1233842] Tue, 21 January 2014 06:16 Go to previous message
Xi Lin is currently offline Xi LinFriend
Messages: 21
Registered: January 2014
Junior Member
Thank you very much!

After some tests I finally succeed. The key factor is creating a tycho based maven project to add the extended generator, and declaring the dependency not only in MANIFEST.MF but also in exec-maven-plugin which invoke the Mwe2Launcher.

And I created a repo to show how to do it if someone is interested in it:
github.com/xilin/maven-xtext-example

Previous Topic:Converting to Docx using xtext/xtend and docx4j
Next Topic:Putting Xtext projects into Git repositories
Goto Forum:
  


Current Time: Sat Apr 20 14:49:57 GMT 2024

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

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

Back to the top