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:
|
public final class ToolInstallRequest { |
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);
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
ToolCommandletandLocalToolCommandletare 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:
IDEasy/cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java
Line 158 in 6324037
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:
IDEasy/cli/src/main/java/com/devonfw/tools/ide/tool/ToolInstallRequest.java
Line 17 in 6324037
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: