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

devonfw / IDEasy / 12890704917

21 Jan 2025 03:52PM UTC coverage: 68.444% (+0.3%) from 68.126%
12890704917

push

github

web-flow
#972: add CustomToolJsonDeserializer to prevent jackson error (#974)

2785 of 4459 branches covered (62.46%)

Branch coverage included in aggregate %.

7201 of 10131 relevant lines covered (71.08%)

3.09 hits per line

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

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

3
import com.devonfw.tools.ide.context.IdeContext;
4
import com.devonfw.tools.ide.property.PluginProperty;
5
import com.devonfw.tools.ide.property.ToolProperty;
6
import com.devonfw.tools.ide.step.Step;
7
import com.devonfw.tools.ide.tool.ToolCommandlet;
8
import com.devonfw.tools.ide.tool.plugin.PluginBasedCommandlet;
9

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

17
  /** The tool to install. */
18
  public final ToolProperty tool;
19

20
  /** The optional version to set and install. */
21
  public final PluginProperty plugin;
22

23
  /**
24
   * The constructor.
25
   *
26
   * @param context the {@link IdeContext}.
27
   */
28
  public InstallPluginCommandlet(IdeContext context) {
29

30
    super(context);
3✔
31
    addKeyword(getName());
4✔
32
    this.tool = add(new ToolProperty("", true, "tool"));
11✔
33
    this.plugin = add(new PluginProperty("", true, "plugin"));
11✔
34
  }
1✔
35

36
  @Override
37
  public String getName() {
38

39
    return "install-plugin";
2✔
40
  }
41

42
  @Override
43
  public void run() {
44
    ToolCommandlet commandlet = this.tool.getValue();
5✔
45
    String plugin = this.plugin.getValue();
5✔
46

47
    if (commandlet instanceof PluginBasedCommandlet cmd) {
6!
48
      try (Step step = context.newStep("Install plugin: " + plugin)) {
7✔
49
        cmd.installPlugin(cmd.getPlugin(plugin), step);
6✔
50
      }
51
    } else {
52
      context.warning("Tool {} does not support installation of plugins.", commandlet.getName());
×
53
    }
54

55
  }
1✔
56

57
  @Override
58
  public ToolCommandlet getToolForCompletion() {
59

60
    return this.tool.getValue();
×
61
  }
62

63
}
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