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 :

A module and its dependency opened in the same workspace

A module and its dependency opened in the same workspace

If the 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.

Warning

If you open, close, import or remove a project, you must refresh the dependency resolution of other previously imported projects by clicking on the Resolve All button :

Resolve all the workspace projects

Resolve all the workspace projects

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.

Note

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.

Note

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.

Resolve Foundation Library in workspace

Resolve Foundation Library in workspace