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.
MMM is based on of 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.
In MicroEJ SDK, a new MicroEJ module project is created as following:
- Select File > New > Project…,
- Select EasyAnt > EasyAnt Project,
- Fill the module information (project name, module organization, name and revision),
- Select one of the suggested skeleton,
- Click on Finish.
The project is created and default files and directories are generated by the MicroEJ Module Manager 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
An Ivy configuration file (
module.ivy) is provided at the root
of each MicroEJ module project to solve classpath dependencies.
<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>
Module Repository Configuration
By default, when starting an empty workspace, MicroEJ SDK is configured to fetch dependencies
from MicroEJ Central Repository and to publish built modules to a local folder.
The repository configuration is stored in an Ivy settings file (
ivysettings.xml), and the default one
is located at
To configure MicroEJ SDK to a custom settings file (usually from an offline repository):
- Select Window > Preferences > Ivy > Settings,
- Set Ivy settings path to a custom
- 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.