Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » What is generated by fornax-oaw-m2-plugin?
What is generated by fornax-oaw-m2-plugin? [message #894221] Sat, 07 July 2012 20:18 Go to next message
Cristiano Gavião is currently offline Cristiano GaviãoFriend
Messages: 279
Registered: July 2009
Senior Member
Hi,

I'm trying to join our recently created xtext projects to our main tycho/hudson building.

Existent projects I could run properly, but with a newly created project which I didn't call the mwe2 manually first, I got some build error because a not generated plugin.xml that is being referenced in the build.properties.

If I run mwe2 using the ide before tycho, the problem don't happen.

So, I would like to know what is generated by fornax-oaw-m2-plugin and if I always need to do one first generation at eclipse before setup it to tycho. This way I could know what I need to add to source control, too.

thanks for any help. regards,

Cristiano
Re: What is generated by fornax-oaw-m2-plugin? [message #894231 is a reply to message #894221] Sat, 07 July 2012 22:26 Go to previous messageGo to next message
Cristiano Gavião is currently offline Cristiano GaviãoFriend
Messages: 279
Registered: July 2009
Senior Member
well, I just figured out that I hadn't set up the plugin properly. I have removed the execution configuration because this error in m2e:
Plugin execution not covered by lifecycle configuration: org.fornax.toolsupport:fornax-oaw-m2-plugin:3.4.0:run-workflow (execution: default, phase: generate-sources)


After I've included the execution tag:
<plugin>
	<groupId>org.fornax.toolsupport</groupId>
	<artifactId>fornax-oaw-m2-plugin</artifactId>
	<version>3.4.0</version>
	<configuration>
	<workflowEngine>mwe2</workflowEngine>
	<workflowDescriptor>src/org/lunifera/metamodel/dsl/behavior/stories/en/GenerateStoryDsl.mwe2</workflowDescriptor>
	</configuration>
	<executions>
		<execution>
			<phase>generate-sources</phase>
			<goals>
				<goal>run-workflow</goal>
			</goals>
		</execution>
	</executions>
</plugin>


and now I'm getting this error:

[INFO] --- fornax-oaw-m2-plugin:3.4.0:run-workflow (default) @ org.lunifera.metamodel.dsl.behavior.stories.en ---
[INFO] Fornax Model Workflow Maven2 Plugin V3.4.0
[INFO] Using M2Eclipse workspace artifacts resolution
[INFO] Executing workflow in forked mode.
[INFO] 0    INFO  StandaloneSetup    - Registering platform uri '/Users/cvgaviao/Development/C4Biz_Projects/lunifera'
[INFO] 855  INFO  StandaloneSetup    - Adding generated EPackage 'org.eclipse.xtext.xbase.XbasePackage'
[INFO] 1233 INFO  GenModelHelper     - Registered GenModel 'http://www.eclipse.org/Xtext/Xbase/XAnnotations' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
[INFO] 1238 INFO  GenModelHelper     - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xtype' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
[INFO] 1258 INFO  GenModelHelper     - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xbase' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
[INFO] 1259 INFO  GenModelHelper     - Registered GenModel 'http://www.eclipse.org/xtext/common/JavaVMTypes' from 'platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel'
[ERROR] 1818 ERROR Mwe2Launcher       - Problems instantiating module org.lunifera.metamodel.dsl.behavior.stories.en.GenerateStoryDsl: java.lang.reflect.InvocationTargetException
[INFO] java.lang.RuntimeException: Problems instantiating module org.lunifera.metamodel.dsl.behavior.stories.en.GenerateStoryDsl: java.lang.reflect.InvocationTargetException
[ERROR] 	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:95)
[ERROR] 	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
[ERROR] 	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
[ERROR] 	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
[ERROR] 	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
[INFO] Caused by: org.eclipse.emf.common.util.WrappedException: java.lang.reflect.InvocationTargetException
[ERROR] 	at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:56)
[ERROR] 	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:143)
[ERROR] 	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
[ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[ERROR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ERROR] 	at java.lang.reflect.Method.invoke(Method.java:597)
[ERROR] 	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
[ERROR] 	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
[ERROR] 	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:142)
[ERROR] 	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
[ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[ERROR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ERROR] 	at java.lang.reflect.Method.invoke(Method.java:597)
[ERROR] 	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
[ERROR] 	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
[ERROR] 	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:142)
[ERROR] 	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
[ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[ERROR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ERROR] 	at java.lang.reflect.Method.invoke(Method.java:597)
[ERROR] 	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
[ERROR] 	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
[ERROR] 	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:80)
[ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[ERROR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ERROR] 	at java.lang.reflect.Method.invoke(Method.java:597)
[ERROR] 	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
[ERROR] 	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
[ERROR] 	at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.create(Mwe2ExecutionEngine.java:62)
[ERROR] 	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:93)
[INFO] 	... 4 more
[INFO] Caused by: java.lang.reflect.InvocationTargetException
[ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[ERROR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ERROR] 	at java.lang.reflect.Method.invoke(Method.java:597)
[ERROR] 	at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:54)
[INFO] 	... 37 more
[INFO] Caused by: org.eclipse.xtext.resource.ClasspathUriResolutionException: java.lang.IllegalStateException: Couldn't find resource on classpath. URI was 'classpath:/org/lunifera/metamodel/dsl/behavior/stories/en/StoryDsl.xtext'
[ERROR] 	at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.resolve(ClassloaderClasspathUriResolver.java:48)
[ERROR] 	at org.eclipse.xtext.resource.XtextResourceSet.resolveClasspathURI(XtextResourceSet.java:118)
[ERROR] 	at org.eclipse.xtext.resource.XtextResourceSet.access$0(XtextResourceSet.java:117)
[ERROR] 	at org.eclipse.xtext.resource.XtextResourceSet$1.normalize(XtextResourceSet.java:174)
[ERROR] 	at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:136)
[ERROR] 	at org.eclipse.xtext.generator.LanguageConfig.setUri(LanguageConfig.java:184)
[INFO] 	... 42 more
[INFO] Caused by: java.lang.IllegalStateException: Couldn't find resource on classpath. URI was 'classpath:/org/lunifera/metamodel/dsl/behavior/stories/en/StoryDsl.xtext'
[ERROR] 	at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.findResourceOnClasspath(ClassloaderClasspathUriResolver.java:60)
[ERROR] 	at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.resolve(ClassloaderClasspathUriResolver.java:45)
[INFO] 	... 47 more
[ERROR] ExitStatusException occurred while running workflow: Java returned: 1


Anyone know what kind error is this?

[Updated on: Sun, 08 July 2012 11:39]

Report message to a moderator

Re: What is generated by fornax-oaw-m2-plugin? [message #894394 is a reply to message #894221] Mon, 09 July 2012 05:27 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Hi Christiano!

The plugin just executes the MWE2 workflow as you would do it from Eclipse. It is not necessary to run the generation once in the IDE before. No generated sources need to be checked in.

Your error simply indicates that the StoryDsl.xtext file is not on the classpath. Find out why. You could enable debug output with "-X", the plugin will print the whole Java command that is executed. Maybe the .xtext file is not in the target/classes of that module?

Kind regards,
~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: What is generated by fornax-oaw-m2-plugin? [message #894502 is a reply to message #894394] Mon, 09 July 2012 13:02 Go to previous messageGo to next message
Cristiano Gavião is currently offline Cristiano GaviãoFriend
Messages: 279
Registered: July 2009
Senior Member
Hi Karsten,

It is a kind strange. The package that contains the files are being exported. The plugin could find the .mwe2 but why not the .xtext ?

I've created a little unit test program inside an osgi bundle fragment and I could find and open the xtext file.

About the generation. the first generation include some files inside the src too. that is generated by maven too ?

thanks,
Cristiano

Re: What is generated by fornax-oaw-m2-plugin? [message #894595 is a reply to message #894394] Mon, 09 July 2012 18:42 Go to previous messageGo to next message
Cristiano Gavião is currently offline Cristiano GaviãoFriend
Messages: 279
Registered: July 2009
Senior Member
Hi Karsten,

After long hours debugging and researching, I was able to make it work using a hack that I've found in Spray project.

I really didn't like it, but it worked. I have to copy out the .xtext and .mwe2 files to a folder that was added as maven resource.

		<resources>
			<resource>
				<directory>${project.build.directory}/xtext</directory>
			</resource>
		</resources>
		<plugins>
			<!-- Copy all Xtext related sources to separate folder that is registered 
				as resource folder -->
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-resources</id>
						<phase>initialize</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/xtext</outputDirectory>
							<resources>
								<resource>
									<directory>src</directory>
									<includes>
										<include>**/*.xtext</include>
										<include>**/*.mwe2</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>


Could you explain me, please, why this is being necessary? It is a tycho deficiency or it is fornax-oaw-m2-plugin that is not setting up the classpath properly?


thanks.

Cristiano

[Updated on: Fri, 13 July 2012 21:00]

Report message to a moderator

Re: What is generated by fornax-oaw-m2-plugin? [message #1176727 is a reply to message #894595] Fri, 08 November 2013 14:11 Go to previous message
Martin Roob is currently offline Martin RoobFriend
Messages: 8
Registered: October 2012
Junior Member
Hi,
I had the same problem just now.
What worked for me, was to add the src-Folder as a resource to the maven pom:

<build>
<resources>
<resource>
<directory>src</directory>
</resource>
</resources>
...

Otherwise, the fornax plugin adds the "maven default" path src/main/resources to the classpath and will not find the .xtext-File.

Previous Topic:Default value of String
Next Topic:Xtend local variable scope?
Goto Forum:
  


Current Time: Tue Apr 23 15:45:42 GMT 2024

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

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

Back to the top