Skip to content

#1987: Fixed GUI not launching for snapshot versions#2036

Open
laim2003 wants to merge 13 commits into
devonfw:mainfrom
laim2003:fix/#1987-Gui-commandlet-broken-for-snapshots
Open

#1987: Fixed GUI not launching for snapshot versions#2036
laim2003 wants to merge 13 commits into
devonfw:mainfrom
laim2003:fix/#1987-Gui-commandlet-broken-for-snapshots

Conversation

@laim2003

@laim2003 laim2003 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #1987

Implemented changes:

  • Added -U flag to the maven execution command
  • Specified maven exec plugin version to 3.1.0
  • Added <repository> definition to the gui-launcher pom file
  • Added --enableLogging / -l flag to the GUI commandlet. This will launch the GUI in ProcessMode.DEFAULTrather then ProcessMode.BACKGROUND_SILENT; this way all internal JavaFX/Maven logs etc are printed to the terminal, making debugging easier.

Testing instructions

Please add conscise, understandable instructions on how a reviewer can test/verify the functionality of your contribution here:

1. Testing the snapshot fix:

a. Team-Review:
  1. Build a native executable based on the state of this branch: GraalVM build guide
  2. Run ide upgrade --mode=snapshot
  3. Using the ideasy executable from step 1, run the gui (see step 4 in the GraalVM build guide)
  4. GUI should now launch without any issues.
b. Retesting after Merge:
  1. Upgrade your IDEasy version to the latest snapshot/nightly build: ide upgrade --mode=snapshot
  2. run ide gui
  3. GUI should now launch without any issues.

Testing the new --enableLogging flag:

a. Team-Review:
  1. Build a native executable based on the state of this branch: GraalVM build guide
  2. Using this ideasy executable, run the gui with the flag-l/--enableLogging (see step 4 in the GraalVM build guide)
  3. Instead of the terminal resuming to the default input state, you should now see all maven and javafx internal logs being printed to the terminal.
b. Retesting after Merge:
  1. Upgrade your IDEasy version to the latest snapshot/nightly build: ide upgrade --mode=snapshot
  2. run ide gui --enableLogging or ide gui -l (small L)
  3. Instead of the terminal resuming to the default input state, you should now see all maven and javafx internal logs being printed to the terminal.

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"

…/--enableLogging flag to enable the printing of logs to the terminal for debugging purposes.
@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Jun 16, 2026
@laim2003 laim2003 self-assigned this Jun 16, 2026
@laim2003 laim2003 added GUI Graphical User Interface of IDEasy (aka dashboard) build with JavaFx commandlet ide sub-command labels Jun 16, 2026
@laim2003 laim2003 moved this from 🆕 New to 🏗 In progress in IDEasy board Jun 16, 2026
@laim2003 laim2003 added this to the release:2026.06.001 milestone Jun 16, 2026
@coveralls

coveralls commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 28702549520

Coverage increased (+0.05%) to 71.879%

Details

  • Coverage increased (+0.05%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 5 coverage regressions across 3 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

5 previously-covered lines in 3 files lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/tool/gui/Gui.java 3 87.88%
com/devonfw/tools/ide/tool/ide/IdeToolCommandlet.java 1 78.33%
com/devonfw/tools/ide/version/VersionSegment.java 1 90.55%

Coverage Stats

Coverage Status
Relevant Lines: 16306
Covered Lines: 12219
Line Coverage: 74.94%
Relevant Branches: 7310
Covered Branches: 4756
Branch Coverage: 65.06%
Branches in Coverage %: Yes
Coverage Strength: 3.17 hits per line

💛 - Coveralls

@laim2003 laim2003 removed this from the release:2026.06.001 milestone Jun 17, 2026
@laim2003 laim2003 added this to the release:2026.07.001 milestone Jun 18, 2026
@laim2003 laim2003 marked this pull request as ready for review June 23, 2026 15:03
@laim2003 laim2003 moved this from 🏗 In progress to Team Review in IDEasy board Jun 23, 2026
laim2003 added 2 commits June 27, 2026 00:33
…broken-for-snapshots' into fix/devonfw#1987-Gui-commandlet-broken-for-snapshots

# Conflicts:
#	cli/src/test/resources/ide-projects/gui/_ide/installation/gui/pom.xml

@maybeec maybeec left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling the SNAPSHOT GUI-launch bug. Switching to context.newProcess() and registering the freshly installed mvn on the IDEasy-managed PATH is a clean approach, and it's good to see a JUnit test covering both process modes. 👍

Reviewing only the diff against the coding conventions (inline suggestions attached where there is an easy fix):

  1. (Medium) A failed launch now reports success (Gui.java L96-102). Previously an exception from runTool propagated and the command failed; now catch (Exception e) logs and returns normally, so ide gui exits successfully even when the GUI never started. Logging the full exception is fine per the Catching and handling Exceptions section, so this isn't a convention breach — but for a CLI a failed launch should arguably surface a non-zero exit, and catch (Exception e) is very broad (it would also swallow programming errors). The inline suggestion wraps-and-rethrows as CliException while keeping your helpful hint.

  2. (Low) Comment wording and length (Gui.java L67-71). Per the Code-Documentation section, implementation comments should factually explain the why. The current text is first-person/speculative ("I tried ... withPathEntry()", "tested on a Mac; potentially ... on Windows"), and L69 (~205 chars) is much longer than the wrapping used elsewhere in the file. A shortened, factual version is suggested inline.

  3. (Low) -U on every launch (Gui.java L82). --update-snapshots forces a remote check on every ide gui, adding latency and requiring network even for released (non-SNAPSHOT) versions. Consider applying it only in snapshot mode.

  4. (Nit) Field visibility (Gui.java L30). Other commandlet property fields are declared public final (e.g. AbstractUpdateCommandlet, CreateCommandlet); enableExtendedLogging is package-private. Making it public final keeps it consistent — suggestion inline.

Nice work overall — none of these are blocking.


private static final Logger LOG = LoggerFactory.getLogger(Gui.class);

final FlagProperty enableExtendedLogging;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other commandlet property fields are declared public final (see e.g. AbstractUpdateCommandlet, CreateCommandlet). For consistency:

Suggested change
final FlagProperty enableExtendedLogging;
/** {@link FlagProperty} to enable logging of the GUI process to the terminal. */
public final FlagProperty enableExtendedLogging;

Comment on lines +67 to +71
/* Register the freshly installed mvn on the IDEasy managed PATH so that the IDEasy controlled maven is used to launch
the GUI instead of any maven that happens to be on the system PATH. We install via installTool (software repository
only) and therefore have to register the bin directory ourselves (install() would normally do this). I tried to achieve this alternatively via .withPathEntry(), however, this did not work as expected.
This was tested on a Mac; potentially, withPathVariable() works correctly on Windows.
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the Code-Documentation conventions, implementation comments should factually explain the why. This drops the first-person/speculative wording and wraps the long line to match the rest of the file:

Suggested change
/* Register the freshly installed mvn on the IDEasy managed PATH so that the IDEasy controlled maven is used to launch
the GUI instead of any maven that happens to be on the system PATH. We install via installTool (software repository
only) and therefore have to register the bin directory ourselves (install() would normally do this). I tried to achieve this alternatively via .withPathEntry(), however, this did not work as expected.
This was tested on a Mac; potentially, withPathVariable() works correctly on Windows.
*/
/*
* Register the freshly installed mvn on the IDEasy-managed PATH so the IDEasy-controlled maven (from the software
* repository) launches the GUI instead of any maven on the system PATH. installTool only installs into the software
* repository, so we register the bin directory here (install() would normally do this).
*/

Comment on lines +96 to +102
try {
mvn.runTool(processContext.withPathEntry(javaInstallation.binDir()), processMode, args);
} catch (Exception e) {
LOG.error(
"Failed to launch the GUI. If maven states issues with dependency resolution, check whether the maven M2 repo is enabled in your project.",
e);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As written, any failure is logged and then swallowed, so ide gui exits successfully even when the GUI never launched. Wrapping-and-rethrowing keeps your hint but surfaces the failure to the caller (and narrows the catch to RuntimeException):

Suggested change
try {
mvn.runTool(processContext.withPathEntry(javaInstallation.binDir()), processMode, args);
} catch (Exception e) {
LOG.error(
"Failed to launch the GUI. If maven states issues with dependency resolution, check whether the maven M2 repo is enabled in your project.",
e);
}
try {
mvn.runTool(processContext.withPathEntry(javaInstallation.binDir()), processMode, args);
} catch (RuntimeException e) {
throw new CliException(
"Failed to launch the GUI. If maven reports issues with dependency resolution, check whether the maven M2 repo is enabled in your project.", e);
}

maybeec added 2 commits July 4, 2026 11:45
…commandlet-broken-for-snapshots

# Conflicts:
#	CHANGELOG.adoc
…i-commandlet-broken-for-snapshots

# Conflicts:
#	CHANGELOG.adoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commandlet ide sub-command GUI Graphical User Interface of IDEasy (aka dashboard) build with JavaFx

Projects

Status: Team Review

Development

Successfully merging this pull request may close these issues.

Gui commandlet broken for snapshots

3 participants