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

devonfw / IDEasy / 22300285724

23 Feb 2026 09:32AM UTC coverage: 70.754% (+0.3%) from 70.474%
22300285724

Pull #1714

github

web-flow
Merge caa980897 into 379acdc9d
Pull Request #1714: #404: #1713: advanced logging

4064 of 6348 branches covered (64.02%)

Branch coverage included in aggregate %.

10640 of 14434 relevant lines covered (73.71%)

3.1 hits per line

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

83.33
cli/src/main/java/com/devonfw/tools/ide/commandlet/InstallPluginCommandlet.java
1
package com.devonfw.tools.ide.commandlet;
2

3
import org.slf4j.Logger;
4
import org.slf4j.LoggerFactory;
5

6
import com.devonfw.tools.ide.context.IdeContext;
7
import com.devonfw.tools.ide.property.PluginProperty;
8
import com.devonfw.tools.ide.property.ToolProperty;
9
import com.devonfw.tools.ide.step.Step;
10
import com.devonfw.tools.ide.tool.ToolCommandlet;
11
import com.devonfw.tools.ide.tool.plugin.PluginBasedCommandlet;
12

13
/**
14
 * {@link Commandlet} to install a tool.
15
 *
16
 * @see ToolCommandlet#install()
17
 */
18
public class InstallPluginCommandlet extends Commandlet {
19

20
  private static final Logger LOG = LoggerFactory.getLogger(InstallPluginCommandlet.class);
4✔
21

22
  /** The tool to install. */
23
  public final ToolProperty tool;
24

25
  /** The optional version to set and install. */
26
  public final PluginProperty plugin;
27

28
  /**
29
   * The constructor.
30
   *
31
   * @param context the {@link IdeContext}.
32
   */
33
  public InstallPluginCommandlet(IdeContext context) {
34

35
    super(context);
3✔
36
    addKeyword(getName());
4✔
37
    this.tool = add(new ToolProperty("", true, "tool"));
11✔
38
    this.plugin = add(new PluginProperty("", true, "plugin"));
11✔
39
  }
1✔
40

41
  @Override
42
  public String getName() {
43

44
    return "install-plugin";
2✔
45
  }
46

47
  @Override
48
  protected void doRun() {
49
    ToolCommandlet commandlet = this.tool.getValue();
5✔
50
    String plugin = this.plugin.getValue();
5✔
51

52
    if (commandlet instanceof PluginBasedCommandlet cmd) {
6!
53
      Step step = context.newStep("Install plugin: " + plugin);
6✔
54
      step.run(() -> cmd.installPlugin(cmd.getPlugin(plugin), step));
14✔
55
    } else {
1✔
56
      LOG.warn("Tool {} does not support installation of plugins.", commandlet.getName());
×
57
    }
58

59
  }
1✔
60

61
  @Override
62
  public ToolCommandlet getToolForCompletion() {
63

64
    return this.tool.getValue();
×
65
  }
66

67
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc