Skip to content

Extend ToolCommandlet installation logic to allow software-repository-only installation requests. #1976

Description

@laim2003

Task summary

Currently, when installing LocalToolCommandlets, the installation logic requires us to be inside a project when installing a tool, e.g. Java. This is, because the installation logic always tries to create symlinks (if not via install(), installToolDependencies() ends up doing this nevertheless). For some use-cases however (like launching the GUI using java and maven), we do need dependencies like java to be installed in the software repo, however, the requirement for being inside a project in order to install those dependencies creates an unnecessary obstacle (example: we want to be able to launch the GUI from everywhere, not only inside project folders, while at the same time still being able to use the java tool installed in the software repo.)

Additional context

Before you assign yourself to this issue: Please note that the installation routine and logic in IDEasy from ToolCommandlet and LocalToolCommandlet are rather complex. So this is not an easy task and not good for beginners in IDEasy. You should already have collected some experience with the installation routine or should be good at reading and understanding code...

We are talking about this:

public ToolInstallation installTool(ToolInstallRequest request) {

That function is also installing dependencies and for each of them ends up here:
https://github.com/devonfw/IDEasy/blob/main/cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java#L276

This should check if we are actually inside a project and if not then do not try to get the configured version and try to install the tool in the project but just create an additional installation from the version range in the software repo.

Another idea of the story above is to add a boolean option here:

This would allow to ignore the current project so the above behaviour to not do the project installation would happen even if I am inside an IDEasy project in case that boolean flag was explicitly set to true:

installRequest.setIgnoreProject(true);

Metadata

Metadata

Assignees

Labels

commandletide sub-commandenhancementNew feature or requestinstallinstallation process of IDE + tools and install commandletjavarelated to Java code, the Java Virtual Machine and directly related tooling (OpenJDK, Adoptium)ready-to-implement

Type

Fields

No fields configured for Task.

Projects

Status
🏗 In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions