Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to generate and package xmi file with maven and xtext 2.9
How to generate and package xmi file with maven and xtext 2.9 [message #1714687] Sun, 15 November 2015 21:13 Go to next message
David Baum is currently offline David BaumFriend
Messages: 20
Registered: August 2014
Junior Member
Hello everyone,

yesterday I tried to port our codebase from xtext 2.8 to xtext 2.9 rc but I have a small problem. Our project structure is like this, using maven as build system:
- mydsl1
- mydsl2
- using_dsl_project
- using_dsl_project_parent


Thas was working with xtext 2.8 and maven (and tycho). When porting the mydsl-projects to XText 2.9 based on the pom from the example project created with the wizard, the created jar in the maven repository does not contain any xmi/xtextbin file anymore. This causes the following error message in the using_dsl_project:

 Error injecting constructor, org.eclipse.emf.common.util.WrappedException: org.eclipse.xtext.resource.ClasspathUriResolutionException: org.eclipse.xtext.resource.FileNotFoundOnClasspathException: Couldn't find resource on classpath. URI was 'classpath:/org/example/MyDSL1.xmi'


in the using_dsl_project the mydsl1 project is added as dependency. The workflow I try to invoke looks like this:

module using_dsl_project_run

var projectName = "using_dsl_run"
var runtimeProject = "../${projectName}"

Workflow {
	bean = org.eclipse.emf.mwe.utils.StandaloneSetup {
    	platformUri = "${runtimeProject}/.."
		registerGeneratedEPackage = "org.example.MyDSL1Package"
	}
	
	component = org.eclipse.xtext.mwe.Reader {
		path = "./input"
		register = org.example.MyDSL1StandaloneSetup {}
		loadResource = {
			slot = "mydsl"
		}
	}

	component = org.svis.generator.ResolveLazyComponent {}
	
	component = org.example.MyDSL12MyDSL2 {
		modelSlot = "mydsl"
	}
}


The error message at the reader component. Do I have to change something in the mydsl project to create the xtextbin file or am I missing something different?

Thanks in advance.

[Updated on: Mon, 16 November 2015 12:33]

Report message to a moderator

Re: How to generate and package xmi file with maven and xtext 2.9 [message #1714850 is a reply to message #1714687] Tue, 17 November 2015 09:40 Go to previous messageGo to next message
Stefan Oehme is currently offline Stefan OehmeFriend
Messages: 159
Registered: April 2010
Location: Kiel
Senior Member

After you run the generator, is the xtextbin file in your src-gen folder?
Re: How to generate and package xmi file with maven and xtext 2.9 [message #1715109 is a reply to message #1714850] Thu, 19 November 2015 10:38 Go to previous messageGo to next message
David Baum is currently offline David BaumFriend
Messages: 20
Registered: August 2014
Junior Member
Yes, src-gen contains mydsl1.xtextbin however it is not part of the jar file.
Re: How to generate and package xmi file with maven and xtext 2.9 [message #1715115 is a reply to message #1715109] Thu, 19 November 2015 11:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14664
Registered: July 2009
Senior Member
Any warnings on build properties?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to generate and package xmi file with maven and xtext 2.9 [message #1715222 is a reply to message #1715115] Fri, 20 November 2015 11:21 Go to previous messageGo to next message
David Baum is currently offline David BaumFriend
Messages: 20
Registered: August 2014
Junior Member
I get the following warning:

[WARNING] The assembly descriptor contains a filesystem-root relative reference, which is not cross platform compatible /
[INFO] Building jar: /home/naraesk/Alma Mater/Forschung/Promotion/workspace/generator_old/ws/org.xtext.example.mydsl1.parent/org.xtext.example.mydsl1/target/org.xtext.example.mydsl1-1.0.0-SNAPSHOT.jar
[WARNING] Configuration options: 'appendAssemblyId' is set to false, and 'classifier' is missing.
Instead of attaching the assembly file: /home/naraesk/Alma Mater/Forschung/Promotion/workspace/generator_old/ws/org.xtext.example.mydsl1.parent/org.xtext.example.mydsl1/target/org.xtext.example.mydsl1-1.0.0-SNAPSHOT.jar, it will become the file for main project artifact.
NOTE: If multiple descriptors or descriptor-formats are provided for this project, the value of this file will be non-deterministic!
[WARNING] Replacing pre-existing project main-artifact file: /home/naraesk/Alma Mater/Forschung/Promotion/workspace/generator_old/ws/org.xtext.example.mydsl1.parent/org.xtext.example.mydsl1/target/org.xtext.example.mydsl1-1.0.0-SNAPSHOT.jar
with assembly file: /home/naraesk/Alma Mater/Forschung/Promotion/workspace/generator_old/ws/org.xtext.example.mydsl1.parent/org.xtext.example.mydsl1/target/org.xtext.example.mydsl1-1.0.0-SNAPSHOT.jar


However the xtext example project, created by the project wizard, produces the same warning. And in the example project the resulting jar contains the xtextbin file. But besides naming/used packages I don't see any differences between my project and the example project. And, btw, I'm using "mvn clean install" for maven, or am I supposed to run a different command?
Re: How to generate and package xmi file with maven and xtext 2.9 [message #1715223 is a reply to message #1715222] Fri, 20 November 2015 11:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14664
Registered: July 2009
Senior Member
no that Looks file. i think the Problem is that maven does not use the src-gen Folder as sources and resources Folder.
so there might be a missconfig in your pom.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to generate and package xmi file with maven and xtext 2.9 [message #1715233 is a reply to message #1715223] Fri, 20 November 2015 13:00 Go to previous message
David Baum is currently offline David BaumFriend
Messages: 20
Registered: August 2014
Junior Member
Since I was not able to find any differences I reset my local .p2 bundled pool and my local m2 maven repository to restart from scratch. I'm not really sure why, but it works now. Smile
Thanks for your patience.
Previous Topic:disabling syntactic sugar for getter/setter
Next Topic:Different hovers for same data type rule
Goto Forum:
  


Current Time: Tue Apr 16 10:40:12 GMT 2024

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

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

Back to the top