From cc318d6fb59f0ab1a4f674dca84eeb6484d4ec73 Mon Sep 17 00:00:00 2001 From: Gilles Querret Date: Wed, 8 Jul 2020 15:55:04 +0200 Subject: [PATCH] Fix warning message when minimal version of required plugin is not installed --- .../java/org/sonar/server/plugins/ServerPluginRepository.java | 4 ++-- .../org/sonar/server/plugins/ServerPluginRepositoryTest.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/sonar-webserver-api/src/main/java/org/sonar/server/plugins/ServerPluginRepository.java b/server/sonar-webserver-api/src/main/java/org/sonar/server/plugins/ServerPluginRepository.java index e1fa8929966..13aee7ef774 100644 --- a/server/sonar-webserver-api/src/main/java/org/sonar/server/plugins/ServerPluginRepository.java +++ b/server/sonar-webserver-api/src/main/java/org/sonar/server/plugins/ServerPluginRepository.java @@ -248,8 +248,8 @@ public class ServerPluginRepository implements PluginRepository, Startable { Version installedRequirementVersion = installedRequirement.getVersion(); if (installedRequirementVersion != null && requiredPlugin.getMinimalVersion().compareToIgnoreQualifier(installedRequirementVersion) > 0) { // it requires a more recent version - LOG.warn("Plugin {} [{}] is ignored because the version {} of required plugin [{}] is not supported", plugin.getName(), plugin.getKey(), - requiredPlugin.getKey(), requiredPlugin.getMinimalVersion()); + LOG.warn("Plugin {} [{}] is ignored because the version {} of required plugin [{}] is not installed", plugin.getName(), plugin.getKey(), + requiredPlugin.getMinimalVersion(), requiredPlugin.getKey()); return false; } } diff --git a/server/sonar-webserver-api/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java b/server/sonar-webserver-api/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java index a44e0c86a8f..4424e517ba0 100644 --- a/server/sonar-webserver-api/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java +++ b/server/sonar-webserver-api/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java @@ -179,6 +179,7 @@ public class ServerPluginRepositoryTest { underTest.start(); + assertThat(logs.logs()).contains("Plugin Test Require New Plugin [testrequire] is ignored because the version 0.2 of required plugin [testbase] is not installed"); // the plugin "requirenew" is not installed as it requires base 0.2+ to be installed. assertThat(underTest.getPluginInfosByKeys()).containsOnlyKeys("testbase"); } -- 2.39.5