• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

devonfw / IDEasy / 30641010734

31 Jul 2026 03:00PM UTC coverage: 72.704% (+0.05%) from 72.652%
30641010734

Pull #2144

github

web-flow
Merge fdbb34695 into 01741256e
Pull Request #2144: #1976: extend tool commandlet installation logic

5052 of 7679 branches covered (65.79%)

Branch coverage included in aggregate %.

13103 of 17292 relevant lines covered (75.77%)

3.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

18.52
cli/src/main/java/com/devonfw/tools/ide/tool/gui/Gui.java
1
package com.devonfw.tools.ide.tool.gui;
2

3
import java.nio.file.Files;
4
import java.nio.file.Path;
5
import java.util.List;
6

7
import org.slf4j.Logger;
8
import org.slf4j.LoggerFactory;
9

10
import com.devonfw.tools.ide.cli.CliException;
11
import com.devonfw.tools.ide.commandlet.Commandlet;
12
import com.devonfw.tools.ide.context.IdeContext;
13
import com.devonfw.tools.ide.process.ProcessContext;
14
import com.devonfw.tools.ide.process.ProcessContextImpl;
15
import com.devonfw.tools.ide.process.ProcessMode;
16
import com.devonfw.tools.ide.tool.ToolEditionAndVersion;
17
import com.devonfw.tools.ide.tool.ToolInstallRequest;
18
import com.devonfw.tools.ide.tool.ToolInstallation;
19
import com.devonfw.tools.ide.tool.java.Java;
20
import com.devonfw.tools.ide.tool.mvn.Mvn;
21
import com.devonfw.tools.ide.version.VersionIdentifier;
22

23
/**
24
 * {@link Commandlet} to launch the IDEasy GUI.
25
 */
26
public class Gui extends Commandlet {
27

28
  private static final Logger LOG = LoggerFactory.getLogger(Gui.class);
4✔
29

30
  /**
31
   * @param context the {@link IdeContext}.
32
   */
33
  public Gui(IdeContext context) {
34

35
    super(context);
3✔
36
    addKeyword(getName());
4✔
37
  }
1✔
38

39
  @Override
40
  public String getName() {
41

42
    return "gui";
2✔
43
  }
44

45
  @Override
46
  protected void doRun() {
47

48
    ProcessContext processContext = new ProcessContextImpl(this.context);
×
49

50
    Java java = this.context.getCommandletManager().getCommandlet(Java.class);
×
51
    Mvn mvn = this.context.getCommandletManager().getCommandlet(Mvn.class);
×
52

53
    ToolInstallRequest mavenToolInstallRequest = new ToolInstallRequest(false);
×
54
    mavenToolInstallRequest.setProcessContext(processContext);
×
55
    mavenToolInstallRequest.setIgnoreProject(true);
×
56

57
    ToolInstallRequest javaToolInstallRequest = new ToolInstallRequest(mavenToolInstallRequest);
×
58
    javaToolInstallRequest.setRequested(
×
59
        new ToolEditionAndVersion(VersionIdentifier.of("25.*"))
×
60
    );
61
    javaToolInstallRequest.setIgnoreProject(true);
×
62

63
    mvn.installTool(mavenToolInstallRequest);
×
64
    ToolInstallation javaInstallation = java.installTool(javaToolInstallRequest);
×
65

66
    LOG.debug("Starting GUI via commandlet");
×
67

68
    Path pomPath = context.getIdeInstallationPath().resolve("gui/pom.xml");
×
69
    if (!Files.exists(pomPath)) {
×
70
      throw new CliException("Fatal error: The pom.xml file required for launching the IDEasy GUI could not be found in expected location: " + pomPath);
×
71
    }
72

73
    List<String> args = List.of(
×
74
        "-f",
75
        pomPath.toString(),
×
76
        "exec:exec",
77
        "-Dexec.executable=java",
78
        "-Dexec.classpathScope=compile",
79
        "-Dexec.args=-classpath %classpath com.devonfw.ide.gui.AppLauncher"
80
    );
81

82
    /*
83
     * We manually update the PATH entry with our java version, as by default IDEasy includes the SymLink under /projectname/software/java/bin in the PATH
84
     * In case of projects using older Java Versions, this is important as the java version of the project could potentially older.
85
     */
86
    mvn.runTool(processContext.withPathEntry(javaInstallation.binDir()), ProcessMode.BACKGROUND_SILENT, args);
×
87
  }
×
88
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc