i have a Question about XText/Maven. I have a XText/Maven/Java Project.
In this Project lie the Xtext Models and Java source Files. Some of the Modelfiles reference some Java files. E.G.:
Model:
package a.b.c
import java.util.List
import x.y.z.MyClass // <-- This is one of the Javafile in the same Project
dto MyModel
{
MyClass myClass
}
Java:
package x.y.z;
public class MyClass
{
String foo;
String bar;
}
Structure:
project
|
|----src/main
|
|---/java/x/y/z/MyClass.java
|
|---/model/a/b/c/MyModel.dto
|
|---/gen/a/b/c/MyModel.java <-- here goes the generated Javafile from the Model
I have already managed to write an Xtext/Eclipse plugin, so the Eclipse build generate my Modelfiles and compiles the Javafiles just fine.
But now i try to build the Project with Maven. I Manage already accomplished the Generate process via an mwe2 Workflow with use of the Class
org.eclipse.emf.mwe2.launch.runtime.MWE2Launcher
and other Modelfiles genrate just fine, but the MyModel references a Java Class that is not yet Compiled and so it is not Found:
[ERROR] Execution Failed: Problems running workflow my.company.model.xtext.domainmodel.generator: Validation problems:
[ERROR] 49 errors:
[ERROR] MyModel.dto - <path>/model/a/b/c/MyModel.dto
[ERROR] 4: x.y.z.MyClass cannot be resolved to a type.
...
So the Error itself is clear. I tryed with sucess to Precompile the Java File first and add these to the Classpath. But i have dozen of this Problems and i hope the is a better way to tell Xtext/Mwe2Launcher that it should reference the requierd Java Files. Because in some magic way it already work in Eclipse but i have no Idea how.