@Property(
key = CoreProperties.DRY_RUN_INCLUDE_PLUGINS,
name = "Plugins accepted for dry run",
+ defaultValue = CoreProperties.DRY_RUN_INCLUDE_PLUGINS_DEFAULT_VALUE,
global = true, project = false,
category = CoreProperties.CATEGORY_GENERAL),
@Property(
key = CoreProperties.DRY_RUN_EXCLUDE_PLUGINS,
name = "Plugins excluded for dry run",
global = true, project = false,
- defaultValue = "devcockpit,pdfreport,report,scmactivity,views",
+ defaultValue = CoreProperties.DRY_RUN_EXCLUDE_PLUGINS_DEFAULT_VALUE,
category = CoreProperties.CATEGORY_GENERAL),
@Property(
key = "sonar.dryRun.export.path",
blacks.addAll(Arrays.asList(settings.getStringArray(CoreProperties.BATCH_EXCLUDE_PLUGINS)));
}
if (settings.getBoolean(CoreProperties.DRY_RUN)) {
- whites.addAll(Arrays.asList(settings.getStringArray(CoreProperties.DRY_RUN_INCLUDE_PLUGINS)));
- blacks.addAll(Arrays.asList(settings.getStringArray(CoreProperties.DRY_RUN_EXCLUDE_PLUGINS)));
+ // These default values are not supported by Settings because the class CorePlugin
+ // is not loaded yet.
+ whites.addAll(propertyValues(settings,
+ CoreProperties.DRY_RUN_INCLUDE_PLUGINS, CoreProperties.DRY_RUN_INCLUDE_PLUGINS_DEFAULT_VALUE));
+ blacks.addAll(propertyValues(settings,
+ CoreProperties.DRY_RUN_EXCLUDE_PLUGINS, CoreProperties.DRY_RUN_EXCLUDE_PLUGINS_DEFAULT_VALUE));
}
if (!whites.isEmpty()) {
LOG.info("Include plugins: " + Joiner.on(", ").join(whites));
}
}
+ static List<String> propertyValues(Settings settings, String key, String defaultValue) {
+ String s = StringUtils.defaultIfEmpty(settings.getString(key), defaultValue);
+ return Arrays.asList(StringUtils.split(s, ","));
+ }
+
boolean accepts(String pluginKey) {
if (CORE_PLUGIN.equals(pluginKey) || ENGLISH_PACK_PLUGIN.equals(pluginKey)) {
return true;
String BATCH_INCLUDE_PLUGINS = "sonar.includePlugins";
String BATCH_EXCLUDE_PLUGINS = "sonar.excludePlugins";
+
/**
* @since 3.4
*/
String DRY_RUN_INCLUDE_PLUGINS = "sonar.dryRun.includePlugins";
+ String DRY_RUN_INCLUDE_PLUGINS_DEFAULT_VALUE = "";
/**
* @since 3.4
*/
String DRY_RUN_EXCLUDE_PLUGINS = "sonar.dryRun.excludePlugins";
+ String DRY_RUN_EXCLUDE_PLUGINS_DEFAULT_VALUE = "devcockpit,pdfreport,report,scmactivity,views";
/**
* @since 2.10