MicroEJ Module Manager
Modern electronic device design involves many parts and teams to collaborate to finally obtain a product to be sold on its market. MicroEJ encourages modular design which involves various stake holders: hardware engineers, UX designers, graphic designers, drivers/BSP engineers, software engineers, etc.
Modular design is a design technique that emphasizes separating the functionality of an application into independent, interchangeable modules. Each module contains everything necessary to execute only one aspect of the desired functionality. In order to have team members collaborate internally within their team and with other teams, MicroEJ provides a powerful modular design concept, with smart module dependencies, controlled by the MicroEJ Module Manager (MMM). MMM frees engineers from the difficult task of computing module dependencies. Engineers specify the bare minimum description of the module requirements.
The following schema introduces the main concepts detailed in this chapter.
MMM is based on the following tools:
- Apache Ivy (http://ant.apache.org/ivy) for dependencies resolution and module publication;
- Apache EasyAnt (https://ant.apache.org/easyant/history/trunk/reference.html) for module build from source code.
MMM provides a non ambiguous semantic for dependencies resolution. Please consult the MMM specification available on https://developer.microej.com/packages/documentation/TLT-0831-SPE-MicroEJModuleManager-2.0-D.pdf.
Module Project Skeleton
In MicroEJ SDK, a new MicroEJ module project is created as following:
- Select File > New > Project…,
- Select MicroEJ > MicroEJ Module Project ,
- Fill the module information (project name, module organization, name and revision),
- Select one of the suggested skeletons depending on the desired module nature,
- Click on Finish.
The project is created and a set of files and directories are generated from the selected skeleton.
When an empty Eclipse project already exists or when the skeleton has to be created within an existing directory, the MicroEJ module is created as following:
- In the Package Explorer, click on the parent project or directory,
- Select File > New > Other…,
- Select EasyAnt > EasyAnt Skeleton.
Module Description File
A module description file is an Ivy configuration file named
module.ivy, located at the root
of each MicroEJ module project.
It describes the module nature (also called build type) and dependencies to other modules.
<ivy-module version="2.0" xmlns:ea="http://www.easyant.org" xmlns:m="http://ant.apache.org/ivy/extra" xmlns:ej="https://developer.microej.com" ej:version="2.0.0"> <info organisation="[organisation]" module="[name]" status="integration" revision="[version]"> <ea:build organisation="com.is2t.easyant.buildtypes" module="[buildtype_name]" revision="[buildtype_version]"> <ea:property name="[buildoption_name]" value="[buildoption_value]"/> </ea:build> </info> <configurations defaultconfmapping="default->default;provided->provided"> <conf name="default" visibility="public"/> <conf name="provided" visibility="public"/> <conf name="documentation" visibility="public"/> <conf name="source" visibility="public"/> <conf name="dist" visibility="public"/> <conf name="test" visibility="private"/> </configurations> <publications> </publications> <dependencies> <dependency org="[dep_organisation]" name="[dep_name]" rev="[dep_version]"/> </dependencies> </ivy-module>
MicroEJ Module Manager Configuration
By default, when starting an empty workspace, MicroEJ SDK is configured to import dependencies
from MicroEJ Central Repository and to publish built modules to a local folder.
The repository configuration is stored in a settings file (
ivysettings.xml), and the default one
is located at
The MMM preferences page is available at Window > Preferences > MicroEJ > Module Manager .
This page allows to configure the following elements:
Options: files declaring MMM options. See the Options section.
Use Module repository as Build repository: the settings file for connecting the build repository in place of the one bundled in MicroEJ SDK. This option shall not be enabled by default and is reserved for advanced configuration.
Build repository Settings File: the settings file for connecting the build repository in place of the one bundled in MicroEJ SDK. This option is automatically initialized the first time MicroEJ SDK is launched. It shall not be modified by default and is reserved for advanced configuration.
Set verbose mode: to enable advanced debug traces when building a module.
Runtime JRE: the Java Runtime Environment that executes the build process.
Max build history size: the maximum number of previous builds available in Build Module shortcut list:
To configure MMM to a custom settings file (usually from an offline repository):
- Set Settings file to a custom
ivysettings.xmlsettings file ,
- Click on Apply and Close button
If the workspace is not empty, it is recommended to trigger a full resolution and rebuild all the projects using this new repository configuration:
- In the Package Explorer, right-click on a project;
- Select Ivy > Clean all caches.
Resolve projects using the new repository
To resolve all the workspace projects, click on the Resolve All button in the toolbar:
To only resolve a subset of the workspace projects:
- In the Package Explorer, select the desired projects,
- Right-click on a project and select Ivy > Clean all caches.
Trigger Add-On Library processors for automatically generated source code
- Select Project > Clean…,
- Select Clean all projects,
- Click on Clean button.
Options can be used to parameterize a module description file or a settings file.
Options are declared as key/value pairs in a standard Java properties file, and are expanded using the
A typical usage in a settings file is for extracting repository server credentials, such as HTTP Basic access authentication:
Declare options in a properties file
Register this property file to MMM options
Use this option in a settings file
A typical usage in a module description file is for factorizing dependency versions across multiple modules projects:
Declare an option in a properties file
Register this property file to MMM options
Use this option in a module description file
The Module Manager build kit is the consistent set of tools and scripts required for building modules.
It is bundled with MicroEJ SDK and can be exported to run in headless mode using the following steps: 
- Select File > Export > MicroEJ > Module Manager Build Kit,
- Choose an empty Target directory,
- Click on the Finish button.
Once the build kit is fully exported, the directory content shall look like:
To go further with headless builds, please consult Tool-CommandLineBuild for command line builds, and this tutorial to setup MicroEJ modules build in continuous integration environments).
|||(1, 2, 3, 4) If using MicroEJ SDK versions lower than |
Former MicroEJ SDK Versions
This section describes MMM configuration elements for MicroEJ SDK versions lower than
New MicroEJ Module Project
The New MicroEJ Module Project wizard is available at File > New > Project…, EasyAnt > EasyAnt Project.
MMM Preferences Pages are located in two dedicated pages. The following pictures show the options mapping using the same options numbers declared in Preferences Page.
Ivy Preferences Page
The Ivy Preferences Page is available at Window > Preferences > Ivy > Settings.
Easyant Preferences Page
The Easyant Preferences Page is available at Window > Preferences > EasyAnt4Eclipse.
Export the Build Kit
- Create an empty directory (e.g.
- Locate your SDK installation plugins directory (by default,
C:\Program Files\MicroEJ\MicroEJ SDK-[version]\rcp\pluginson Windows OS),
- Open the file
com.is2t.eclipse.plugin.easyant4e_[version].jarwith an archive manager,
- Extract the directory
libto the target directory,
- Open the file
com.is2t.eclipse.plugin.easyant4e.offlinerepo_[version].jarwith an archive manager,
- Navigate to directory
- Extract the file named
microej-build-repository.zipfor MicroEJ SDK
is2t_repo.zipfor MicroEJ SDK
4.1.xto the target directory.