mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
Update required plugins if available
When plugins are updated, we should update required plugins, too, so that we do not get errors when new plugins use features not available in the old versions of required plugins.
This commit is contained in:
@@ -247,18 +247,18 @@ public class DefaultPluginManager implements PluginManager {
|
||||
|
||||
private List<AvailablePlugin> collectPluginsToInstall(String name) {
|
||||
List<AvailablePlugin> plugins = new ArrayList<>();
|
||||
collectPluginsToInstall(plugins, name, true);
|
||||
collectPluginsToInstallOrUpdate(plugins, name);
|
||||
return plugins;
|
||||
}
|
||||
|
||||
private void collectPluginsToInstall(List<AvailablePlugin> plugins, String name, boolean isUpdate) {
|
||||
if (!isInstalledOrPending(name) || isUpdate && isUpdatable(name)) {
|
||||
private void collectPluginsToInstallOrUpdate(List<AvailablePlugin> plugins, String name) {
|
||||
if (!isInstalledOrPending(name) || isUpdatable(name)) {
|
||||
AvailablePlugin plugin = getAvailable(name).orElseThrow(() -> NotFoundException.notFound(entity(AvailablePlugin.class, name)));
|
||||
|
||||
Set<String> dependencies = plugin.getDescriptor().getDependencies();
|
||||
if (dependencies != null) {
|
||||
for (String dependency : dependencies) {
|
||||
collectPluginsToInstall(plugins, dependency, false);
|
||||
collectPluginsToInstallOrUpdate(plugins, dependency);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user