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

devonfw / IDEasy / 19751480105

28 Nov 2025 01:26AM UTC coverage: 69.441% (+0.3%) from 69.136%
19751480105

push

github

web-flow
#1613: fixed duplicated CVE check and refactored installation routine (#1614)

3696 of 5851 branches covered (63.17%)

Branch coverage included in aggregate %.

9620 of 13325 relevant lines covered (72.2%)

3.14 hits per line

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

79.17
cli/src/main/java/com/devonfw/tools/ide/tool/ide/IdeaBasedIdeToolCommandlet.java
1
package com.devonfw.tools.ide.tool.ide;
2

3
import java.util.ArrayList;
4
import java.util.Arrays;
5
import java.util.List;
6
import java.util.Set;
7

8
import com.devonfw.tools.ide.common.Tag;
9
import com.devonfw.tools.ide.context.IdeContext;
10
import com.devonfw.tools.ide.process.ProcessContext;
11
import com.devonfw.tools.ide.process.ProcessMode;
12
import com.devonfw.tools.ide.process.ProcessResult;
13
import com.devonfw.tools.ide.step.Step;
14
import com.devonfw.tools.ide.tool.plugin.ToolPluginDescriptor;
15

16
/**
17
 * {@link IdeToolCommandlet} for IDEA based commandlets like: {@link com.devonfw.tools.ide.tool.intellij.Intellij IntelliJ} and
18
 * {@link com.devonfw.tools.ide.tool.androidstudio.AndroidStudio Android Studio}.
19
 */
20
public class IdeaBasedIdeToolCommandlet extends IdeToolCommandlet {
21

22
  /**
23
   * The constructor.
24
   *
25
   * @param context the {@link IdeContext}.
26
   * @param tool the {@link #getName() tool name}.
27
   * @param tags the {@link #getTags() tags} classifying the tool. Should be created via {@link Set#of(Object) Set.of} method.
28
   */
29
  public IdeaBasedIdeToolCommandlet(IdeContext context, String tool, Set<Tag> tags) {
30
    super(context, tool, tags);
5✔
31
  }
1✔
32

33
  @Override
34
  public boolean installPlugin(ToolPluginDescriptor plugin, final Step step, ProcessContext pc) {
35

36
    // In case of plugins with a custom repo url
37
    boolean customRepo = plugin.url() != null;
6!
38
    List<String> args = new ArrayList<>();
4✔
39
    args.add("installPlugins");
4✔
40
    args.add(plugin.id().replace("+", " "));
8✔
41
    if (customRepo) {
2!
42
      args.add(plugin.url());
5✔
43
    }
44
    ProcessResult result = runTool(pc, ProcessMode.DEFAULT, args.toArray(String[]::new));
12✔
45
    if (result.isSuccessful()) {
3!
46
      this.context.success("Successfully installed plugin: {}", plugin.name());
11✔
47
      step.success();
2✔
48
      return true;
2✔
49
    } else {
50
      step.error("Failed to install plugin {} ({}): exit code was {}", plugin.name(), plugin.id(), result.getExitCode());
×
51
      return false;
×
52
    }
53
  }
54

55
  @Override
56
  public ProcessResult runTool(String... args) {
57
    List<String> extendedArgs = new ArrayList<>(Arrays.asList(args));
6✔
58
    extendedArgs.add(this.context.getWorkspacePath().toString());
7✔
59
    return super.runTool(extendedArgs.toArray(new String[0]));
8✔
60
  }
61
}
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