The modules of modelant are Java libraries, that are to be integrated in modelant and client other programs as their dependencies. In addition modelant publishes its complete and independent components as Maven plugins, so they could be used through Maven or Gradle. Here we provide just examples, see the documentation of the modelant modules for detailed explanations.


The modeling lanugaes (metamodels), supported by modelant 3+ are only those in OMG MOF 1.4 and XMI 1.1/XMI 1.2. The use of modelant follows some patterns:

  • In Java - as of [A4], use the ModelRepositoryFactory to initialize and instantiate the Model repository (wrapping the Netbeans Metamodel Repository). The repository constructs ModelFactory instances, each as a factory to produce extents in a specific metamodel, i.e. modeling language. Each extent is a javax.jmi.reflect.RefPackage instance, that stores an instance (model) of that metamodel, this way supporting the creation, load, processing and writing models in different modeling languages.
  • In Maven - some specific selfcontained processes are also published as Maven plugins, this way reducing the need to write code and hiding the described complexity.

Example usage of modelant in code

modelant is intended for direct use in Java code

import javax.jmi.reflect.RefPackage;
import net.mdatools.modelant.repository.api.ModelRepositoryFactory;
import net.mdatools.modelant.repository.api.ModelRepository;
ModelRepository repository;
ModelFactory modelFactory;
RefPackage modelExtent;
repository = ModelRepositoryFactory.construct(workDirectory);

modelFactory = repository.loadMetamodel("UML13");

modelExtent = modelFactory.instantiate("model extent name");  
repository.readIntoExtent(modelExtent, "model file path" );
modelFactory.readExtent(modelExtent, new File("model file path"));
use the modelant core and the metamodel implementation to query and manipulate the model
modelFactory.writeExtent(modelExtent, new File("model file path"));

Example usage of modelant Maven plugin

modelant provides Maven plugins that publish complete processes on models. See the corresponding documentation.