Skip to content

#2279: allow launching the GUI without an IDEasy project - #2285

Open
quando632 wants to merge 4 commits into
devonfw:mainfrom
quando632:feature/2279-gui-shortcut-without-project
Open

#2279: allow launching the GUI without an IDEasy project#2285
quando632 wants to merge 4 commits into
devonfw:mainfrom
quando632:feature/2279-gui-shortcut-without-project

Conversation

@quando632

@quando632 quando632 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #2279

The desktop shortcut added by #1917 is created correctly but never starts the GUI, because it launches ideasy gui from outside any IDEasy project.

Implemented changes:

  • Gui no longer requires IDE_HOME. IDE_ROOT is still required, since the launcher pom and the project list resolve relative to it. Project selection happens inside the GUI, which reads the projects from IDE_ROOT via ProjectManager.
  • The bin directory of the resolved Maven installation is registered in the SystemPath. Without IDE_HOME there is no project software folder, so mvn was not resolvable and the launch failed with CreateProcess error=2.
  • New GuiTest covering both the relaxed IDE_HOME requirement and that IDE_ROOT stays required.

Testing instructions

  1. Build the branch: mvn -o package -DskipTests in cli.
  2. Open a shell that has no IDE_HOME set and change into a directory outside any IDEasy project, for example your home directory.
  3. Run the gui commandlet from that directory.
  4. Expected: the GUI window opens. Before this change the run aborted with The gui commandlet requires an IDEasy project to work.

Note that ide-gui must be resolvable from USER_HOME/.m2 or a remote repository, since without IDE_HOME the Maven configuration folder falls back to USER_HOME/.m2 (Mvn.java:282-283). On a SNAPSHOT developer installation you may need to run mvn -pl gui -am install first.


Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled
    with internal
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

The desktop shortcut runs "ideasy gui" and does not set a working
directory, so the process starts outside of any IDEasy project. Gui did
not override isIdeHomeRequired() and therefore inherited the default
true, which made the commandlet abort with "The gui commandlet requires
an IDEasy project to work". A desktop shortcut is by definition launched
from outside a project, so it could never work.

Gui now declares that IDE_HOME is not required. IDE_ROOT is still
required, as both the launcher pom.xml and the project list are resolved
relative to it. Project selection happens inside the GUI, which reads the
available projects from IDE_ROOT via ProjectManager.

Without IDE_HOME the mvn binary is no longer resolvable either:
SystemPath.findBinary only searches tool2pathMap and paths, but never
extraPathEntries, so ProcessContext.withPathEntry() does not influence
the binary resolution of IDEasy itself. With IDE_HOME this never shows
because tool2pathMap is populated from the software folder of the
project. The bin directory of the resolved Maven installation is now
registered in the SystemPath, analogous to what LocalToolCommandlet does
after a fresh installation.
@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Aug 6, 2026
@quando632 quando632 added the GUI Graphical User Interface of IDEasy (aka dashboard) build with JavaFx label Aug 6, 2026
@quando632 quando632 self-assigned this Aug 6, 2026
@quando632 quando632 moved this from 🆕 New to Team Review in IDEasy board Aug 7, 2026
@hohwille hohwille moved this from Team Review to 👀 In review in IDEasy board Aug 7, 2026
@hohwille hohwille self-assigned this Aug 7, 2026
ToolCommandlet.createToolInstallation leaves binDir null when rootDir is
null, and SystemPath.findBinaryInOrder resolves against the path without
a null check. A null value in the tool map would therefore break the next
binary lookup. LocalToolCommandlet applies the same guard before calling
setPath.
…t IDE_HOME

The registration is meant for the case the shortcut hits, where no
project software folder exists to resolve mvn from. Inside a project the
tool map is already filled from that folder, and since this commandlet
requests the latest Maven rather than the configured one, registering it
would silently run a different Maven version than before.

The registration moved into registerMvnBinDir so both branches and the
null bin directory can be covered by tests. Verified by mutation: without
the IDE_HOME condition the in-project test fails, and without the null
check the lookup fails with a NullPointerException.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GUI Graphical User Interface of IDEasy (aka dashboard) build with JavaFx

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

Desktop shortcut for the GUI does not work: gui commandlet requires IDE_HOME

2 participants