Skip to main content



      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 05:33 Go to next message
Eclipse UserFriend
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: Tue, 21 January 2014 22:52] by Moderator

Re: Post processing in standalone maven project [message #1233842 is a reply to message #1233722] Mon, 20 January 2014 11:16 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Post processing in standalone maven project [message #1234058 is a reply to message #1233842] Tue, 21 January 2014 01:16 Go to previous message
Eclipse UserFriend
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: Fri Jul 25 01:36:31 EDT 2025

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

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

Back to the top