Registering packages and sub packages in OAW
I was having troubles with trying to register a metamodel in OAW; in particular,
- My saved model files did not have the xsi:schemaLocation attribute set, so OAW couldn’t find it in them
- I wanted to use an external .ecore file to specify the metamodel
- My .ecore consisted of multiple sub packages
- Ideally, I would like to have used the .ecore from a separate Eclipse plugin
- I was using < EMF 2.4 so I couldn’t use org.eclipse.emf.ecore.dynamic_package
The solution was to add the generated model code plugin as a dependency of the OAW plugin, and register the root model Package (inspiration):
<bean class="org.eclipse.mwe.emf.StandaloneSetup">
<platformUri value=".."/>
<registerGeneratedEPackage value="org.openiaml.model.model.ModelPackage" />
</bean>
There is no need to do something like this, because it will register sub-packages automatically:
<!-- not needed -->
<registerGeneratedEPackage value="org.openiaml.model.model.visual.VisualPackage" />
This didn’t work, because it couldn’t load sub-EPackages:
<!-- doesn't load sub packages: -->
<registerEcoreFile value="src/metamodel/iaml.ecore"/>
You can also see my workflow file directly.