Chapter 4. Registering Ecore file

Usually, when deploying a code for a given metamodel, we deploy this metamodel in a EMF plugin that contains the generated java code for this metamodel. When using this, Eclipse takes care of registering the EPackage in its registry.

If for some reason you don't want to deploy the java version of the metamodel, you can also manually register it directly from an ecore file.

In the graphical interface, this will be done by

right click on the ecore file > EPackage registration > Register EPackage into repository

.

If you need to add an ecore file into the registry programmatically, you can do it in two ways: