diff options
4 files changed, 15 insertions, 31 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java index 5caa64ee892..dbf7b8af7d1 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java @@ -258,12 +258,11 @@ import java.util.List; @Property( key = CoreProperties.SCM_ENABLED_KEY, defaultValue = "true", - name = "Activation of the SCM Sensor", - description = "This property can be set to false in order to deactivate the SCM Sensor.", + name = "Activation of the SCM Activity step", + description = "This property can be set to false in order to deactivate the SCM Activity step.", module = false, project = true, global = true, - category = CoreProperties.CATEGORY_SCM, type = PropertyType.BOOLEAN ), @Property( @@ -274,7 +273,7 @@ import java.util.List; module = false, project = true, global = false, - category = CoreProperties.CATEGORY_SCM + type = PropertyType.BOOLEAN ) }) public final class CorePlugin extends SonarPlugin { diff --git a/server/sonar-server/src/main/java/org/sonar/server/plugins/ServerPluginJarsInstaller.java b/server/sonar-server/src/main/java/org/sonar/server/plugins/ServerPluginJarsInstaller.java index 5f02a203649..5abc8a0eaef 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/plugins/ServerPluginJarsInstaller.java +++ b/server/sonar-server/src/main/java/org/sonar/server/plugins/ServerPluginJarsInstaller.java @@ -20,6 +20,7 @@ package org.sonar.server.plugins; import com.google.common.base.Joiner; +import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.commons.io.FileUtils; @@ -37,12 +38,9 @@ import org.sonar.updatecenter.common.PluginReferential; import java.io.File; import java.io.IOException; -import java.util.Arrays; import java.util.Collection; -import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; public class ServerPluginJarsInstaller { @@ -53,10 +51,9 @@ public class ServerPluginJarsInstaller { private final ServerPluginJarInstaller installer; private final Map<String, PluginMetadata> pluginByKeys = Maps.newHashMap(); private final ServerUpgradeStatus serverUpgradeStatus; - private final static Set<String> BLACKLISTED_PLUGINS = new HashSet<String>(Arrays.asList("scmactivity")); public ServerPluginJarsInstaller(Server server, ServerUpgradeStatus serverUpgradeStatus, - DefaultServerFileSystem fs, ServerPluginJarInstaller installer) { + DefaultServerFileSystem fs, ServerPluginJarInstaller installer) { this.server = server; this.serverUpgradeStatus = serverUpgradeStatus; this.fs = fs; @@ -89,26 +86,18 @@ public class ServerPluginJarsInstaller { for (File file : fs.getUserPlugins()) { DefaultPluginMetadata metadata = installer.extractMetadata(file, false); if (StringUtils.isNotBlank(metadata.getKey())) { - loadInstalledPlugin(metadata); - } - } - } - - private void loadInstalledPlugin(DefaultPluginMetadata metadata) { - if (BLACKLISTED_PLUGINS.contains(metadata.getKey())) { - LOG.warn("Plugin {} is blacklisted. Please uninstall it.", metadata.getName()); - } else { - PluginMetadata existing = pluginByKeys.put(metadata.getKey(), metadata); - if (existing != null) { - throw MessageException.of(String.format("Found two files for the same plugin '%s': %s and %s", - metadata.getKey(), metadata.getFile().getName(), existing.getFile().getName())); + PluginMetadata existing = pluginByKeys.put(metadata.getKey(), metadata); + if (existing != null) { + throw MessageException.of(String.format("Found two files for the same plugin '%s': %s and %s", + metadata.getKey(), metadata.getFile().getName(), existing.getFile().getName())); + } } } } private void moveDownloadedPlugins() { if (fs.getDownloadedPluginsDir().exists()) { - Collection<File> sourceFiles = FileUtils.listFiles(fs.getDownloadedPluginsDir(), new String[] {"jar"}, false); + Collection<File> sourceFiles = FileUtils.listFiles(fs.getDownloadedPluginsDir(), new String[]{"jar"}, false); for (File sourceFile : sourceFiles) { overridePlugin(sourceFile, true); } @@ -128,6 +117,7 @@ public class ServerPluginJarsInstaller { } } + private void overridePlugin(File sourceFile, boolean deleteSource) { File destDir = fs.getUserPluginsDir(); File destFile = new File(destDir, sourceFile.getName()); @@ -191,7 +181,7 @@ public class ServerPluginJarsInstaller { public List<String> getUninstalls() { List<String> names = Lists.newArrayList(); if (fs.getTrashPluginsDir().exists()) { - List<File> files = (List<File>) FileUtils.listFiles(fs.getTrashPluginsDir(), new String[] {"jar"}, false); + List<File> files = (List<File>) FileUtils.listFiles(fs.getTrashPluginsDir(), new String[]{"jar"}, false); for (File file : files) { names.add(file.getName()); } @@ -201,7 +191,7 @@ public class ServerPluginJarsInstaller { public void cancelUninstalls() { if (fs.getTrashPluginsDir().exists()) { - List<File> files = (List<File>) FileUtils.listFiles(fs.getTrashPluginsDir(), new String[] {"jar"}, false); + List<File> files = (List<File>) FileUtils.listFiles(fs.getTrashPluginsDir(), new String[]{"jar"}, false); for (File file : files) { try { FileUtils.moveFileToDirectory(file, fs.getUserPluginsDir(), false); diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 30a2f5b1d9d..bc649128268 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -947,7 +947,7 @@ property.error.notBoolean=Valid options are "true" and "false" property.error.notInteger=Only digits are allowed property.error.notFloat=Not a floating point number property.error.notInOptions=Not a valid option -property.category.scm=SCM + #------------------------------------------------------------------------------ diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java index 416b250af37..b0d48001837 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java @@ -619,11 +619,6 @@ public interface CoreProperties { /** * @since 5.0 */ - String CATEGORY_SCM = "scm"; - - /** - * @since 5.0 - */ String SCM_ENABLED_KEY = "sonar.scm.enabled"; /** |