Skip to content

#1880: Allow reset of installed plugins when launching IDE in force mode#1891

Open
areinicke wants to merge 10 commits intodevonfw:mainfrom
areinicke:feature/1880-reset-ide-plugins-when-using-force
Open

#1880: Allow reset of installed plugins when launching IDE in force mode#1891
areinicke wants to merge 10 commits intodevonfw:mainfrom
areinicke:feature/1880-reset-ide-plugins-when-using-force

Conversation

@areinicke
Copy link
Copy Markdown
Contributor

@areinicke areinicke commented May 5, 2026

This PR fixes #1880

Implemented changes:

  • When launching an IDE in force mode, the user is now prompted whether they want to reset the installed plugins for the IDE. Resetting plugins causes all installed plugins to be deleted. Thereafter, plugins are reinstalled as configured in the project settings.

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

@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board May 5, 2026
@areinicke areinicke self-assigned this May 5, 2026
@areinicke areinicke moved this from 🆕 New to Team Review in IDEasy board May 5, 2026
@areinicke areinicke added enhancement New feature or request settings ide-settings repo and replated processes and features plugins related to plugins (for Eclipse, Intellij, VSCode, etc.) labels May 5, 2026
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented May 5, 2026

Coverage Report for CI Build 25566036672

Coverage decreased (-0.04%) to 70.645%

Details

  • Coverage decreased (-0.04%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 13 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

13 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/tool/plugin/PluginBasedCommandlet.java 12 81.65%
com/devonfw/tools/ide/version/VersionSegment.java 1 89.24%

Coverage Stats

Coverage Status
Relevant Lines: 15420
Covered Lines: 11354
Line Coverage: 73.63%
Relevant Branches: 6886
Covered Branches: 4404
Branch Coverage: 63.96%
Branches in Coverage %: Yes
Coverage Strength: 3.11 hits per line

💛 - Coveralls

@satorus satorus self-assigned this May 6, 2026
@satorus satorus self-requested a review May 6, 2026 07:27
Comment thread cli/src/main/java/com/devonfw/tools/ide/tool/plugin/PluginBasedCommandlet.java Outdated
@satorus
Copy link
Copy Markdown
Contributor

satorus commented May 6, 2026

I tested the -f option with vscode and intellij. With vscode, everything works and looks good! With intellij i get this one always (not sure if this comes from your changes, i guess not...):

Also happens without the -f option, so i guess this is another error...your changes look good!

Start: Install plugin PlantUMLIntegration
Running command 'C:\Users\rwenzel\projects\IDEasy\software\intellij\bin\idea64.exe' with arguments 'installPlugins' 'PlantUML integration' 'C:\Users\rwenzel\projects\IDEasy\workspaces\main'
failed with exit code 1!
Running command 'C:\Users\rwenzel\projects\IDEasy\software\intellij\bin\idea64.exe' with arguments 'installPlugins' 'PlantUML integration' 'C:\Users\rwenzel\projects\IDEasy\workspaces\main'
failed with exit code 1!
com.devonfw.tools.ide.cli.CliProcessException: Running command 'C:\Users\rwenzel\projects\IDEasy\software\intellij\bin\idea64.exe' with arguments 'installPlugins' 'PlantUML integration' 'C:\Users\rwenzel\projects\IDEasy\workspaces\main'
failed with exit code 1!
        at com.devonfw.tools.ide.process.ProcessContextImpl.performLogging(ProcessContextImpl.java:399)
        at com.devonfw.tools.ide.process.ProcessContextImpl.run(ProcessContextImpl.java:242)
        at com.devonfw.tools.ide.tool.ToolCommandlet.runTool(ToolCommandlet.java:248)
        at com.devonfw.tools.ide.tool.ide.IdeaBasedIdeToolCommandlet.runTool(IdeaBasedIdeToolCommandlet.java:90)
        at com.devonfw.tools.ide.tool.ide.IdeaBasedIdeToolCommandlet.installPlugin(IdeaBasedIdeToolCommandlet.java:58)
        at com.devonfw.tools.ide.tool.plugin.PluginBasedCommandlet.doInstallPluginStep(PluginBasedCommandlet.java:174)
        at com.devonfw.tools.ide.tool.plugin.PluginBasedCommandlet.lambda$installPlugins$0(PluginBasedCommandlet.java:161)
        at com.devonfw.tools.ide.step.Step.run(Step.java:228)
        at com.devonfw.tools.ide.step.Step.run(Step.java:217)
        at com.devonfw.tools.ide.tool.plugin.PluginBasedCommandlet.installPlugins(PluginBasedCommandlet.java:161)
        at com.devonfw.tools.ide.tool.plugin.PluginBasedCommandlet.installPlugins(PluginBasedCommandlet.java:142)
        at com.devonfw.tools.ide.tool.plugin.PluginBasedCommandlet.postInstall(PluginBasedCommandlet.java:124)
        at com.devonfw.tools.ide.tool.ToolCommandlet.toolAlreadyInstalled(ToolCommandlet.java:559)
        at com.devonfw.tools.ide.tool.LocalToolCommandlet.installTool(LocalToolCommandlet.java:173)
        at com.devonfw.tools.ide.tool.LocalToolCommandlet.doInstallStep(LocalToolCommandlet.java:96)
        at com.devonfw.tools.ide.tool.LocalToolCommandlet.doInstall(LocalToolCommandlet.java:86)
        at com.devonfw.tools.ide.tool.ToolCommandlet.install(ToolCommandlet.java:302)
        at com.devonfw.tools.ide.tool.ide.IdeToolCommandlet.install(IdeToolCommandlet.java:70)
        at com.devonfw.tools.ide.tool.ToolCommandlet.runTool(ToolCommandlet.java:230)
        at com.devonfw.tools.ide.tool.ToolCommandlet.runTool(ToolCommandlet.java:211)
        at com.devonfw.tools.ide.tool.ToolCommandlet.runTool(ToolCommandlet.java:190)
        at com.devonfw.tools.ide.tool.ide.IdeToolCommandlet.runTool(IdeToolCommandlet.java:63)
        at com.devonfw.tools.ide.tool.ToolCommandlet.doRun(ToolCommandlet.java:166)
        at com.devonfw.tools.ide.tool.ide.IdeToolCommandlet.doRun(IdeToolCommandlet.java:57)
        at com.devonfw.tools.ide.commandlet.Commandlet.run(Commandlet.java:232)
        at com.devonfw.tools.ide.context.AbstractIdeContext.applyAndRun(AbstractIdeContext.java:1315)
        at com.devonfw.tools.ide.context.AbstractIdeContext.run(AbstractIdeContext.java:1140)
        at com.devonfw.tools.ide.cli.Ideasy.runOrThrow(Ideasy.java:91)
        at com.devonfw.tools.ide.cli.Ideasy.run(Ideasy.java:55)
        at com.devonfw.tools.ide.cli.Ideasy.main(Ideasy.java:134)

Step 'Install plugin PlantUMLIntegration' ended with failure.
 Step 'Install plugin PlantUMLIntegration' failed: unexpected error
1 step(s) failed out of 3 steps.

@areinicke
Copy link
Copy Markdown
Contributor Author

Yeah. The PlantUML extension seems to be broken. But like you said, this has nothing to do with my changes.

@areinicke areinicke moved this from Team Review to 👀 In review in IDEasy board May 6, 2026
Copy link
Copy Markdown
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

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

@areinicke thank you for your story idea and this PR implementing it. Great that you also found the perfect spot to document the new feature. 👍
I do have one concern and would like to suggest some improvement via my review comment. Please have a look and consider a small upgrade of this PR. Thanks.

Comment on lines +116 to +121
boolean resetPlugins = this.context.question(
"You are launching " + getName() + " in force mode. Do you want to reset all plugins for " + getName() + "? "
+ "This will uninstall all currently installed plugins and reinstall them as configured in your IDEasy project settings.");
if (resetPlugins) {
deleteAllPlugins(pluginsInstallationPath);
}
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.

We should limit questions only to the bare minimum (dangerous situations) for UX reasons.
If you want to avoid accidents you can add an explicit FlagProperty called --force-plugins or --force-plugin-reinstall. Example:

this.forcePlugins = add(new FlagProperty("--force-plugins"));

I would actually recommend that approach. See also issue #1007

But if you run this use-case frequently you will IMHO start getting annoyed by such question.
If the option --force will remove and reinstall all plugins, then it should do that without asking.
If I do not want to have it, then I do not use --force option.

Suggested change
boolean resetPlugins = this.context.question(
"You are launching " + getName() + " in force mode. Do you want to reset all plugins for " + getName() + "? "
+ "This will uninstall all currently installed plugins and reinstall them as configured in your IDEasy project settings.");
if (resetPlugins) {
deleteAllPlugins(pluginsInstallationPath);
}
deleteAllPlugins(pluginsInstallationPath);

SystemInfo systemInfo = SystemInfoMock.of(os);
IdeTestContext context = newContext(PROJECT_ECLIPSE, "eclipseproject");
context.setSystemInfo(systemInfo);
context.getStartContext().setForceMode(true); // #663
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.

This already confirms my suggestion that we should use an explicit flag.
Seems the test was broken by the change since force mode would now cause additional side-effects breaking the existing test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request plugins related to plugins (for Eclipse, Intellij, VSCode, etc.) settings ide-settings repo and replated processes and features

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

Reinstall all plugins for IDE in force mode

4 participants