Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Hand over properties from Maven to MWE2 Workflow Descriptor
Hand over properties from Maven to MWE2 Workflow Descriptor [message #658798] Wed, 09 March 2011 19:52 Go to next message
No real name is currently offline No real nameFriend
Messages: 4
Registered: March 2011
Junior Member
Hi all,

I recently managed to integrate and build my XText 1.0.1 project(s) with Maven, by using the Fornax 3.2.0 M2 Plugin. However, I now need to "hand over" some project-specific settings (or rather "variables") from my Maven settings file to the MWE2 workflow execution. So basically, I want some variables in my MWE2 workflow descriptor (like the "path.src.gen" and the "path.src.gen.subdir" variable in the example below) to be set with values from my "pom.xml".
component = org.eclipse.xpand2.Generator {
	expand = "test::Template::main FOR model"
	outlet = {
		path = "${path.src.gen}/${path.src.gen.subdir}"
	}		
	fileEncoding = "UTF-8"
}

After having searched the web and played around with several different approaches (e.g. to provide corresponding properties in the Fornax plugin's configuration section; or to let Maven create a properties file next to the MWE2 workflow descriptor file) which all did not work, I totally ran out of ideas. So I would be very happy about any information of how to "hand over" and read properties/variables from Maven (or at least, from a properties file) into a MWE2 workflow descriptor.
Re: Hand over properties from Maven to MWE2 Workflow Descriptor [message #658882 is a reply to message #658798] Thu, 10 March 2011 09:48 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi,

-p paramName=paramValue should work as arguments to the java main method
of the Mwe2Launcher.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 09.03.11 20:52, schrieb lgprime@web.de:
> Hi all,
> I recently managed to integrate and build my XText 1.0.1 project(s) with
> Maven, by using the Fornax 3.2.0 M2 Plugin. However, I now need to "hand
> over" some project-specific settings (or rather "variables") from my
> Maven settings file to the MWE2 workflow execution. So basically, I want
> some variables in my MWE2 workflow descriptor (like the "path.src.gen"
> and the "path.src.gen.subdir" variable in the example below) to be set
> with values from my "pom.xml".
> component = org.eclipse.xpand2.Generator {
> expand = "test::Template::main FOR model"
> outlet = {
> path = "${path.src.gen}/${path.src.gen.subdir}"
> }
> fileEncoding = "UTF-8"
> }
>
> After having searched the web and played around with several different
> approaches (e.g. to provide corresponding properties in the Fornax
> plugin's configuration section; or to let Maven create a properties file
> next to the MWE2 workflow descriptor file) which all did not work, I
> totally ran out of ideas. So I would be very happy about any information
> of how to "hand over" and read properties/variables from Maven (or at
> least, from a properties file) into a MWE2 workflow descriptor.
Re: Hand over properties from Maven to MWE2 Workflow Descriptor [message #658898 is a reply to message #658798] Thu, 10 March 2011 10:46 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

The Fornax plugin passes configured properties to the MWE2Launcher. It should be configured like this:
<configuration>
<properties>
  <key1>value1</key1>
  <key2>value2</key2>
</properties>
</configuration>


The latest released version of the plugin is 3.2.3. Try to upgrade.

You could see the complete command line that the plugin executes if you enable debug output with "-X".

~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de

[Updated on: Thu, 10 March 2011 10:46]

Report message to a moderator

Re: Hand over properties from Maven to MWE2 Workflow Descriptor [message #658954 is a reply to message #658798] Thu, 10 March 2011 14:51 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 4
Registered: March 2011
Junior Member
Handing over the variables' settings in the Fornax Plugin's configuration properties section -- as suggested by Karsten -- eventually did the trick!

I am not quite sure what I did wrong the first time I tried this. But as it perfectly works now, I am not exactly motivated to do any further investigations.

In any case, thank you all a lot for the prompt and useful support!

[Updated on: Thu, 10 March 2011 14:59]

Report message to a moderator

Re: Hand over properties from Maven to MWE2 Workflow Descriptor [message #972538 is a reply to message #658954] Mon, 05 November 2012 18:00 Go to previous message
betty jhonson is currently offline betty jhonsonFriend
Messages: 3
Registered: April 2011
Junior Member
Can I ask how did you do it exactly? Would you share your pom and workflow files? I'm trying to do the very same thing and I just can't get it work well.
I've defined the variable in the properties tag in the fornax plugin and it still doesn't recognize it
Thanks,
Previous Topic:Adding new fields in code generator
Next Topic:Serializing unassigned keyword needed by quick fix
Goto Forum:
  


Current Time: Fri Apr 26 10:53:17 GMT 2024

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

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

Back to the top