From d56233e1c93ba92746d0d40d875fae839876e8a5 Mon Sep 17 00:00:00 2001 From: areinicke <167530118+areinicke@users.noreply.github.com> Date: Tue, 5 May 2026 10:23:07 +0200 Subject: [PATCH 1/7] Adds option to reset plugins when running in force mode --- .../tool/plugin/PluginBasedCommandlet.java | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/plugin/PluginBasedCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/tool/plugin/PluginBasedCommandlet.java index 75eec695b1..a7dd4acc56 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/plugin/PluginBasedCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/plugin/PluginBasedCommandlet.java @@ -110,7 +110,24 @@ protected void postInstall(ToolInstallRequest request) { Path pluginsInstallationPath = getPluginsInstallationPath(); FileAccess fileAccess = this.context.getFileAccess(); if (!request.isAlreadyInstalled()) { - fileAccess.delete(pluginsInstallationPath); + deletePlugins(pluginsInstallationPath); + } else if (this.context.isForceMode()) { + // Prompt user if they want to reset all plugins + 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) { + deletePlugins(pluginsInstallationPath); + } + } + fileAccess.mkdirs(pluginsInstallationPath); + installPlugins(request.getProcessContext()); + } + + private void deletePlugins(Path pluginsInstallationPath) { + + FileAccess fileAccess = this.context.getFileAccess(); + fileAccess.delete(pluginsInstallationPath); List markerFiles = fileAccess.listChildren(this.context.getIdeHome().resolve(IdeContext.FOLDER_DOT_IDE), Files::isRegularFile); for (Path path : markerFiles) { if (path.getFileName().toString().startsWith("plugin." + getName())) { @@ -118,9 +135,7 @@ protected void postInstall(ToolInstallRequest request) { fileAccess.delete(path); } } - } - fileAccess.mkdirs(pluginsInstallationPath); - installPlugins(request.getProcessContext()); + } private void installPlugins(ProcessContext pc) { From 28329489bad624bde5ac70262306fc02add57acb Mon Sep 17 00:00:00 2001 From: areinicke <167530118+areinicke@users.noreply.github.com> Date: Tue, 5 May 2026 10:38:52 +0200 Subject: [PATCH 2/7] Update documentation --- documentation/plugin.adoc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/documentation/plugin.adoc b/documentation/plugin.adoc index fccd1dfd40..0cc2b623ff 100644 --- a/documentation/plugin.adoc +++ b/documentation/plugin.adoc @@ -30,3 +30,12 @@ For `VisualStudio Code`, this is the extension ID you can directly get from the |`active`|`true`|(optional) `true` to tell IDEasy that this plugin shall be installed automatically for everybody in your team. Default is `false`. If not auto-installed, it can still be installed via `ide install-plugin «ide» «plugin»`. |`tags`|e.g. `java,spring,ai`|(optional) Tags to classify the plugin. Will be used by the GUI of IDEasy for selection by tag. |=== + + +== Resetting installed plugins + +When first installing an IDE using `ide install «ide»`, IDEasy will automatically install all plugins that are configured in the project settings. +This configuration is intended to serve as a baseline for the entire team. +However, after the initial setup, you can freely change the plugin configuration for your IDE as you see fit. + +To revert to the initial plugin configuration, you can run `ide -f «ide»`, which will give you the option to uninstall all installed plugins and reinstall them as configured in your project settings. From a3367e4e1d6f4bc3c1910bcc956cd5165b69cc9e Mon Sep 17 00:00:00 2001 From: areinicke <167530118+areinicke@users.noreply.github.com> Date: Tue, 5 May 2026 10:39:30 +0200 Subject: [PATCH 3/7] Update method name to make it more descriptive --- .../tools/ide/tool/plugin/PluginBasedCommandlet.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/plugin/PluginBasedCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/tool/plugin/PluginBasedCommandlet.java index a7dd4acc56..f83b4f8679 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/plugin/PluginBasedCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/plugin/PluginBasedCommandlet.java @@ -110,21 +110,21 @@ protected void postInstall(ToolInstallRequest request) { Path pluginsInstallationPath = getPluginsInstallationPath(); FileAccess fileAccess = this.context.getFileAccess(); if (!request.isAlreadyInstalled()) { - deletePlugins(pluginsInstallationPath); + deleteAllPlugins(pluginsInstallationPath); } else if (this.context.isForceMode()) { // Prompt user if they want to reset all plugins 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) { - deletePlugins(pluginsInstallationPath); + deleteAllPlugins(pluginsInstallationPath); } } fileAccess.mkdirs(pluginsInstallationPath); installPlugins(request.getProcessContext()); } - private void deletePlugins(Path pluginsInstallationPath) { + private void deleteAllPlugins(Path pluginsInstallationPath) { FileAccess fileAccess = this.context.getFileAccess(); fileAccess.delete(pluginsInstallationPath); From 85c288286f7eeadb6c0a840650081b859f34ef9d Mon Sep 17 00:00:00 2001 From: areinicke <167530118+areinicke@users.noreply.github.com> Date: Tue, 5 May 2026 10:45:39 +0200 Subject: [PATCH 4/7] Add changelog --- CHANGELOG.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index a8dcae4f64..627c504f6a 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -19,6 +19,7 @@ Release with new features and bugfixes: * https://github.com/devonfw/IDEasy/issues/1853[#1853]: Add ARM releases for VSCode on Mac * https://github.com/devonfw/IDEasy/issues/797[#797]: Use system unzip on macOS to preserve symlinks in ZIP extraction * https://github.com/devonfw/IDEasy/issues/1723[#1723]: Add commandlet for GitHub Copilot CLI +* https://github.com/devonfw/IDEasy/issues/1880[#1880]: Reinstall all plugins for IDE in force mode The full list of changes for this release can be found in https://github.com/devonfw/IDEasy/milestone/44?closed=1[milestone 2026.05.001]. From 62506bad1cac430063e11095b044048c4f878533 Mon Sep 17 00:00:00 2001 From: areinicke <167530118+areinicke@users.noreply.github.com> Date: Tue, 5 May 2026 13:47:50 +0200 Subject: [PATCH 5/7] Change to test --- .../java/com/devonfw/tools/ide/tool/eclipse/EclipseTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/test/java/com/devonfw/tools/ide/tool/eclipse/EclipseTest.java b/cli/src/test/java/com/devonfw/tools/ide/tool/eclipse/EclipseTest.java index d5b90fdeba..f3996b3997 100644 --- a/cli/src/test/java/com/devonfw/tools/ide/tool/eclipse/EclipseTest.java +++ b/cli/src/test/java/com/devonfw/tools/ide/tool/eclipse/EclipseTest.java @@ -34,7 +34,7 @@ void testEclipse(String os) throws IOException { SystemInfo systemInfo = SystemInfoMock.of(os); IdeTestContext context = newContext(PROJECT_ECLIPSE, "eclipseproject"); context.setSystemInfo(systemInfo); - context.getStartContext().setForceMode(true); // #663 + //context.getStartContext().setForceMode(true); // #663 Eclipse eclipse = context.getCommandletManager().getCommandlet(Eclipse.class); // act From 238397152e8003ea88527168a0caa2260f380f1c Mon Sep 17 00:00:00 2001 From: areinicke <167530118+areinicke@users.noreply.github.com> Date: Tue, 5 May 2026 13:58:49 +0200 Subject: [PATCH 6/7] Remove commented out statement from test --- .../java/com/devonfw/tools/ide/tool/eclipse/EclipseTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/cli/src/test/java/com/devonfw/tools/ide/tool/eclipse/EclipseTest.java b/cli/src/test/java/com/devonfw/tools/ide/tool/eclipse/EclipseTest.java index f3996b3997..ba8e55af25 100644 --- a/cli/src/test/java/com/devonfw/tools/ide/tool/eclipse/EclipseTest.java +++ b/cli/src/test/java/com/devonfw/tools/ide/tool/eclipse/EclipseTest.java @@ -34,7 +34,6 @@ void testEclipse(String os) throws IOException { SystemInfo systemInfo = SystemInfoMock.of(os); IdeTestContext context = newContext(PROJECT_ECLIPSE, "eclipseproject"); context.setSystemInfo(systemInfo); - //context.getStartContext().setForceMode(true); // #663 Eclipse eclipse = context.getCommandletManager().getCommandlet(Eclipse.class); // act From 0c981db6256f6c89fb1b0def4e9bba07d6b1dd8d Mon Sep 17 00:00:00 2001 From: areinicke <167530118+areinicke@users.noreply.github.com> Date: Wed, 6 May 2026 09:41:31 +0200 Subject: [PATCH 7/7] Move log statement after action --- .../devonfw/tools/ide/tool/plugin/PluginBasedCommandlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/plugin/PluginBasedCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/tool/plugin/PluginBasedCommandlet.java index f83b4f8679..cd7fd2897c 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/plugin/PluginBasedCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/plugin/PluginBasedCommandlet.java @@ -131,8 +131,8 @@ private void deleteAllPlugins(Path pluginsInstallationPath) { List markerFiles = fileAccess.listChildren(this.context.getIdeHome().resolve(IdeContext.FOLDER_DOT_IDE), Files::isRegularFile); for (Path path : markerFiles) { if (path.getFileName().toString().startsWith("plugin." + getName())) { - LOG.debug("Plugin marker file {} got deleted.", path); fileAccess.delete(path); + LOG.debug("Plugin marker file {} got deleted.", path); } }