Skip to main content



      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 16:13 Go to next message
Eclipse UserFriend
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 07:33] by 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 04:40 Go to previous messageGo to next message
Eclipse UserFriend
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 05:38 Go to previous messageGo to next message
Eclipse UserFriend
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 06:08 Go to previous messageGo to next message
Eclipse UserFriend
Any warnings on build properties?
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 06:21 Go to previous messageGo to next message
Eclipse UserFriend
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 06:26 Go to previous messageGo to next message
Eclipse UserFriend
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.
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 08:00 Go to previous message
Eclipse UserFriend
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: Thu Jul 24 15:15:50 EDT 2025

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

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

Back to the top