Resolve Dependencies in Workspace¶
When resolving the modules’ dependencies, if the project of a dependency is imported and opened in the same workspace as the module, the project is directly used for compilation and execution instead of using the dependency, provided that the dependency’s project has the same version as the one required by the module.
For example, suppose that the workspace contains a module
myApp and its dependency
mylib project’s version is
1.0.0, it is used for compilation and execution.
Otherwise the published artifact is downloaded from the artifact repository.
To avoid a dependency to be resolved in the workspace, you can close the corresponding project or remove it from the workspace.
Resolve Foundation Libraries in Workspace¶
A Foundation Library is composed of :
- An API project that contains Java classes, methods and fields used at compile time with their associated Javadoc,
- An Implementation project that contains the runtime code executed by the Platform and Low Level C header files
Beside Foundation Library projects, there is usually a Mock project that contains the implementation of native methods for simulation.
To learn how to setup a Foundation Library, please consult the How-to available on https://github.com/MicroEJ/How-To/tree/master/FoundationLibrary-Get-Started.
When the API is set as a dependency, the Implementation project is automatically used at runtime if it is opened in the workspace.
If a Mock project is also opened in the workspace, it is automatically used for execution on Simulator.
When opened in the workspace, the Implementation project and the Mock project are used regardless of their version or if they are set as dependencies.
To avoid the use of the Implementation project and the Mock project, uncheck the Resolve Foundation Library in workspace option in Window > Preferences > MicroEJ > Settings.