I am relatively new to the EMF community, and was hoping someone could provide some insight into my problem.
I am producing an Xpand project, which will be distributed as part of a framework. I will be shipping a JAR to other people who wish to consume this framework. It is intended that within this JAR I will provide the metamodel in ecore format, and the relevant Xpand files (xpt, Checks.chk and Extensions.ext).
Consuming projects will then simply need to implement the metamodel in a XMI file, and have a mwe2 file which describes how to invoke the code generator.
Working with the example project, I am envisaging the following:
consuming-project (Eclipse Project)
Looking at the Model.xmi file that is created with the sample project, the reference from the XMI model to the underlying metamodel seems to be established in the root tag:
As far as I can establish, this is being facilitated by the relative path 'metamodel/metamodel.ecore'.
If I have both the "modelling-framework" and "consuming-project" as two eclipse projects in the same workspace, I can change this relative path to:
NOTE: I've had to remove the "http" protocol from the URLs to prevent the Forum software from rejecting my post. D'oh!
This use of "classpath:/metamodel/metamodel.ecore" is successful. However, if I only have "consuming-project" in my workspace, and reference a built jar of "modelling-framework", I receive the following error:
Couldn't find resource on classpath : classpath:/metamodel/metamodel.ecore
I have checked the built jar file, and I can confirm that the ecore file is present at the specified path. In fact, the following code (in the "consuming-project" yeilds a JarURLConnection:
Is there some magic to refer to a metamodel from within a JAR file?
Any pointers would be greatly appreciated,