aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java4
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/i18n/I18nManager.java (renamed from plugins/sonar-i18n-plugin/src/main/java/org/sonar/plugins/i18n/I18nManager.java)4
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/i18n/InstalledPlugin.java (renamed from plugins/sonar-i18n-plugin/src/main/java/org/sonar/plugins/i18n/InstalledPlugin.java)2
-rw-r--r--plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/i18n/FrenchLanguagePack.java (renamed from plugins/sonar-i18n-plugin/src/test/java/org/sonar/plugins/i18n/utils/FrenchLanguagePack.java)2
-rw-r--r--plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/i18n/I18nManagerTest.java (renamed from plugins/sonar-i18n-plugin/src/test/java/org/sonar/plugins/i18n/I18nManagerTest.java)13
-rw-r--r--plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/i18n/QuebecLanguagePack.java (renamed from plugins/sonar-i18n-plugin/src/test/java/org/sonar/plugins/i18n/utils/QuebecLanguagePack.java)2
-rw-r--r--plugins/sonar-core-plugin/src/test/resources/FrenchPlugin.jar (renamed from plugins/sonar-i18n-plugin/src/test/resources/FrenchPlugin.jar)bin1058 -> 1058 bytes
-rw-r--r--plugins/sonar-core-plugin/src/test/resources/FrenchPlugin/META-INF/MANIFEST.MF (renamed from plugins/sonar-i18n-plugin/src/test/resources/FrenchPlugin/META-INF/MANIFEST.MF)0
-rw-r--r--plugins/sonar-core-plugin/src/test/resources/FrenchPlugin/org/sonar/i18n/test_fr.properties (renamed from plugins/sonar-i18n-plugin/src/test/resources/FrenchPlugin/org/sonar/i18n/test_fr.properties)0
-rw-r--r--plugins/sonar-core-plugin/src/test/resources/QuebecPlugin.jar (renamed from plugins/sonar-i18n-plugin/src/test/resources/QuebecPlugin.jar)bin1051 -> 1051 bytes
-rw-r--r--plugins/sonar-core-plugin/src/test/resources/QuebecPlugin/META-INF/MANIFEST.MF (renamed from plugins/sonar-i18n-plugin/src/test/resources/QuebecPlugin/META-INF/MANIFEST.MF)0
-rw-r--r--plugins/sonar-core-plugin/src/test/resources/QuebecPlugin/org/sonar/i18n/test_fr_CA.properties (renamed from plugins/sonar-i18n-plugin/src/test/resources/QuebecPlugin/org/sonar/i18n/test_fr_CA.properties)0
-rw-r--r--plugins/sonar-core-plugin/src/test/resources/StandardPlugin.jar (renamed from plugins/sonar-i18n-plugin/src/test/resources/StandardPlugin.jar)bin1068 -> 1068 bytes
-rw-r--r--plugins/sonar-core-plugin/src/test/resources/StandardPlugin/META-INF/MANIFEST.MF (renamed from plugins/sonar-i18n-plugin/src/test/resources/StandardPlugin/META-INF/MANIFEST.MF)0
-rw-r--r--plugins/sonar-core-plugin/src/test/resources/StandardPlugin/org/sonar/i18n/test.properties (renamed from plugins/sonar-i18n-plugin/src/test/resources/StandardPlugin/org/sonar/i18n/test.properties)0
-rw-r--r--plugins/sonar-core-plugin/src/test/resources/logback-test.xml (renamed from plugins/sonar-i18n-plugin/src/test/resources/logback-test.xml)0
-rw-r--r--plugins/sonar-i18n-plugin/src/main/java/org/sonar/plugins/i18n/I18nPlugin.java36
-rw-r--r--plugins/sonar-i18n-plugin/src/test/java/org/sonar/plugins/i18n/I18nPluginTest.java33
-rw-r--r--pom.xml1
-rw-r--r--sonar-application/pom.xml6
-rw-r--r--sonar-application/src/main/assembly/conf/logback.xml2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java12
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java26
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java4
-rw-r--r--sonar-server/pom.xml6
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/i18n_controller.rb64
26 files changed, 112 insertions, 105 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 f3b72b9e0c1..87d1e406442 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
@@ -34,6 +34,7 @@ import org.sonar.plugins.core.charts.XradarChart;
import org.sonar.plugins.core.colorizers.JavaColorizerFormat;
import org.sonar.plugins.core.duplicationsviewer.DuplicationsViewerDefinition;
import org.sonar.plugins.core.hotspots.Hotspots;
+import org.sonar.plugins.core.i18n.I18nManager;
import org.sonar.plugins.core.metrics.UserManagedMetrics;
import org.sonar.plugins.core.security.ApplyProjectRolesDecorator;
import org.sonar.plugins.core.sensors.*;
@@ -227,6 +228,9 @@ public class CorePlugin extends SonarPlugin {
extensions.add(NewCoverageFileAnalyzer.class);
extensions.add(NewCoverageAggregator.class);
+ // i18n
+ extensions.add(I18nManager.class);
+
return extensions;
}
}
diff --git a/plugins/sonar-i18n-plugin/src/main/java/org/sonar/plugins/i18n/I18nManager.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/i18n/I18nManager.java
index 6846f88b4ae..8438b706622 100644
--- a/plugins/sonar-i18n-plugin/src/main/java/org/sonar/plugins/i18n/I18nManager.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/i18n/I18nManager.java
@@ -17,7 +17,7 @@
* License along with Sonar; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
-package org.sonar.plugins.i18n;
+package org.sonar.plugins.core.i18n;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -108,7 +108,7 @@ public final class I18nManager implements I18n, ServerExtension, BatchExtension
URL propertiesUrl = resources.get(0);
if (!alreadyLoadedResources.contains(propertiesUrl.toURI())) {
LOG.debug("Found the ResourceBundle base file : {} from classloader : {}", propertiesUrl, classloader);
- LOG.info("Add bundleName : {} from classloader : {}", bundleBaseName, classloader);
+ LOG.debug("Add bundleName : {} from classloader : {}", bundleBaseName, classloader);
bundleClassLoader.addResource(bundleDefaultPropertiesFile, classloader);
alreadyLoadedResources.add(propertiesUrl.toURI());
diff --git a/plugins/sonar-i18n-plugin/src/main/java/org/sonar/plugins/i18n/InstalledPlugin.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/i18n/InstalledPlugin.java
index d0348df1370..abe4b3cf0de 100644
--- a/plugins/sonar-i18n-plugin/src/main/java/org/sonar/plugins/i18n/InstalledPlugin.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/i18n/InstalledPlugin.java
@@ -17,7 +17,7 @@
* License along with Sonar; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
-package org.sonar.plugins.i18n;
+package org.sonar.plugins.core.i18n;
import com.google.common.collect.Lists;
import org.sonar.api.Plugin;
diff --git a/plugins/sonar-i18n-plugin/src/test/java/org/sonar/plugins/i18n/utils/FrenchLanguagePack.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/i18n/FrenchLanguagePack.java
index 98c09780bfb..e781f5a891f 100644
--- a/plugins/sonar-i18n-plugin/src/test/java/org/sonar/plugins/i18n/utils/FrenchLanguagePack.java
+++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/i18n/FrenchLanguagePack.java
@@ -17,7 +17,7 @@
* License along with Sonar; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
-package org.sonar.plugins.i18n.utils;
+package org.sonar.plugins.core.i18n;
import org.sonar.api.i18n.LanguagePack;
diff --git a/plugins/sonar-i18n-plugin/src/test/java/org/sonar/plugins/i18n/I18nManagerTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/i18n/I18nManagerTest.java
index f4d075750f6..380f65efe3d 100644
--- a/plugins/sonar-i18n-plugin/src/test/java/org/sonar/plugins/i18n/I18nManagerTest.java
+++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/i18n/I18nManagerTest.java
@@ -17,9 +17,10 @@
* License along with Sonar; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
-package org.sonar.plugins.i18n;
+package org.sonar.plugins.core.i18n;
import com.google.common.collect.Lists;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.sonar.api.i18n.LanguagePack;
@@ -36,9 +37,9 @@ import static org.mockito.Mockito.mock;
public class I18nManagerTest {
- public static String TEST_PLUGIN_CLASS_NAME = "org.sonar.plugins.i18n.utils.StandardPlugin";
- public static String FRENCH_PACK_CLASS_NAME = "org.sonar.plugins.i18n.utils.FrenchLanguagePack";
- public static String QUEBEC_PACK_CLASS_NAME = "org.sonar.plugins.i18n.utils.QuebecLanguagePack";
+ public static String TEST_PLUGIN_CLASS_NAME = "org.sonar.plugins.core.i18n.StandardPlugin";
+ public static String FRENCH_PACK_CLASS_NAME = "org.sonar.plugins.core.i18n.FrenchLanguagePack";
+ public static String QUEBEC_PACK_CLASS_NAME = "org.sonar.plugins.core.i18n.QuebecLanguagePack";
private static URL classSource = I18nManagerTest.class.getProtectionDomain().getCodeSource().getLocation();
private I18nManager manager;
@@ -93,8 +94,8 @@ public class I18nManagerTest {
public void shouldTranslateUnknownValue() {
String result = manager.message(Locale.FRENCH, "unknown", "Default value for Unknown");
assertEquals("Default value for Unknown", result);
- assertEquals(1, manager.getUnknownKeys().size());
- assertEquals("Default value for Unknown", manager.getUnknownKeys().getProperty("unknown"));
+ Assert.assertEquals(1, manager.getUnknownKeys().size());
+ Assert.assertEquals("Default value for Unknown", manager.getUnknownKeys().getProperty("unknown"));
}
public static class TestClassLoader extends URLClassLoader {
diff --git a/plugins/sonar-i18n-plugin/src/test/java/org/sonar/plugins/i18n/utils/QuebecLanguagePack.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/i18n/QuebecLanguagePack.java
index 5e9913e2156..c8ed96a4edb 100644
--- a/plugins/sonar-i18n-plugin/src/test/java/org/sonar/plugins/i18n/utils/QuebecLanguagePack.java
+++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/i18n/QuebecLanguagePack.java
@@ -17,7 +17,7 @@
* License along with Sonar; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
-package org.sonar.plugins.i18n.utils;
+package org.sonar.plugins.core.i18n;
import org.sonar.api.i18n.LanguagePack;
diff --git a/plugins/sonar-i18n-plugin/src/test/resources/FrenchPlugin.jar b/plugins/sonar-core-plugin/src/test/resources/FrenchPlugin.jar
index ab61bd88697..ab61bd88697 100644
--- a/plugins/sonar-i18n-plugin/src/test/resources/FrenchPlugin.jar
+++ b/plugins/sonar-core-plugin/src/test/resources/FrenchPlugin.jar
Binary files differ
diff --git a/plugins/sonar-i18n-plugin/src/test/resources/FrenchPlugin/META-INF/MANIFEST.MF b/plugins/sonar-core-plugin/src/test/resources/FrenchPlugin/META-INF/MANIFEST.MF
index a45029d3531..a45029d3531 100644
--- a/plugins/sonar-i18n-plugin/src/test/resources/FrenchPlugin/META-INF/MANIFEST.MF
+++ b/plugins/sonar-core-plugin/src/test/resources/FrenchPlugin/META-INF/MANIFEST.MF
diff --git a/plugins/sonar-i18n-plugin/src/test/resources/FrenchPlugin/org/sonar/i18n/test_fr.properties b/plugins/sonar-core-plugin/src/test/resources/FrenchPlugin/org/sonar/i18n/test_fr.properties
index cc8efa7afc3..cc8efa7afc3 100644
--- a/plugins/sonar-i18n-plugin/src/test/resources/FrenchPlugin/org/sonar/i18n/test_fr.properties
+++ b/plugins/sonar-core-plugin/src/test/resources/FrenchPlugin/org/sonar/i18n/test_fr.properties
diff --git a/plugins/sonar-i18n-plugin/src/test/resources/QuebecPlugin.jar b/plugins/sonar-core-plugin/src/test/resources/QuebecPlugin.jar
index 101df34ba6d..101df34ba6d 100644
--- a/plugins/sonar-i18n-plugin/src/test/resources/QuebecPlugin.jar
+++ b/plugins/sonar-core-plugin/src/test/resources/QuebecPlugin.jar
Binary files differ
diff --git a/plugins/sonar-i18n-plugin/src/test/resources/QuebecPlugin/META-INF/MANIFEST.MF b/plugins/sonar-core-plugin/src/test/resources/QuebecPlugin/META-INF/MANIFEST.MF
index a45029d3531..a45029d3531 100644
--- a/plugins/sonar-i18n-plugin/src/test/resources/QuebecPlugin/META-INF/MANIFEST.MF
+++ b/plugins/sonar-core-plugin/src/test/resources/QuebecPlugin/META-INF/MANIFEST.MF
diff --git a/plugins/sonar-i18n-plugin/src/test/resources/QuebecPlugin/org/sonar/i18n/test_fr_CA.properties b/plugins/sonar-core-plugin/src/test/resources/QuebecPlugin/org/sonar/i18n/test_fr_CA.properties
index 38b5b84ccdf..38b5b84ccdf 100644
--- a/plugins/sonar-i18n-plugin/src/test/resources/QuebecPlugin/org/sonar/i18n/test_fr_CA.properties
+++ b/plugins/sonar-core-plugin/src/test/resources/QuebecPlugin/org/sonar/i18n/test_fr_CA.properties
diff --git a/plugins/sonar-i18n-plugin/src/test/resources/StandardPlugin.jar b/plugins/sonar-core-plugin/src/test/resources/StandardPlugin.jar
index 73deac7e8b6..73deac7e8b6 100644
--- a/plugins/sonar-i18n-plugin/src/test/resources/StandardPlugin.jar
+++ b/plugins/sonar-core-plugin/src/test/resources/StandardPlugin.jar
Binary files differ
diff --git a/plugins/sonar-i18n-plugin/src/test/resources/StandardPlugin/META-INF/MANIFEST.MF b/plugins/sonar-core-plugin/src/test/resources/StandardPlugin/META-INF/MANIFEST.MF
index a45029d3531..a45029d3531 100644
--- a/plugins/sonar-i18n-plugin/src/test/resources/StandardPlugin/META-INF/MANIFEST.MF
+++ b/plugins/sonar-core-plugin/src/test/resources/StandardPlugin/META-INF/MANIFEST.MF
diff --git a/plugins/sonar-i18n-plugin/src/test/resources/StandardPlugin/org/sonar/i18n/test.properties b/plugins/sonar-core-plugin/src/test/resources/StandardPlugin/org/sonar/i18n/test.properties
index 88aabfe61a2..88aabfe61a2 100644
--- a/plugins/sonar-i18n-plugin/src/test/resources/StandardPlugin/org/sonar/i18n/test.properties
+++ b/plugins/sonar-core-plugin/src/test/resources/StandardPlugin/org/sonar/i18n/test.properties
diff --git a/plugins/sonar-i18n-plugin/src/test/resources/logback-test.xml b/plugins/sonar-core-plugin/src/test/resources/logback-test.xml
index cdc8866fe3a..cdc8866fe3a 100644
--- a/plugins/sonar-i18n-plugin/src/test/resources/logback-test.xml
+++ b/plugins/sonar-core-plugin/src/test/resources/logback-test.xml
diff --git a/plugins/sonar-i18n-plugin/src/main/java/org/sonar/plugins/i18n/I18nPlugin.java b/plugins/sonar-i18n-plugin/src/main/java/org/sonar/plugins/i18n/I18nPlugin.java
deleted file mode 100644
index 0e6495c021a..00000000000
--- a/plugins/sonar-i18n-plugin/src/main/java/org/sonar/plugins/i18n/I18nPlugin.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.plugins.i18n;
-
-import org.sonar.api.SonarPlugin;
-
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * @since 2.9
- */
-public final class I18nPlugin extends SonarPlugin {
-
- public List getExtensions() {
- return Arrays.asList(I18nManager.class, I18nWebService.class);
- }
-
-}
diff --git a/plugins/sonar-i18n-plugin/src/test/java/org/sonar/plugins/i18n/I18nPluginTest.java b/plugins/sonar-i18n-plugin/src/test/java/org/sonar/plugins/i18n/I18nPluginTest.java
deleted file mode 100644
index 9fc007149e8..00000000000
--- a/plugins/sonar-i18n-plugin/src/test/java/org/sonar/plugins/i18n/I18nPluginTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.plugins.i18n;
-
-import org.junit.Test;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.number.OrderingComparisons.greaterThanOrEqualTo;
-
-public class I18nPluginTest {
-
- @Test
- public void shouldGetExtensions() {
- assertThat(new I18nPlugin().getExtensions().size(), greaterThanOrEqualTo(2));
- }
-}
diff --git a/pom.xml b/pom.xml
index fb95f636230..5e43e693a05 100644
--- a/pom.xml
+++ b/pom.xml
@@ -48,7 +48,6 @@
<module>plugins/sonar-cpd-plugin</module>
<module>plugins/sonar-squid-java-plugin</module>
<module>plugins/sonar-design-plugin</module>
- <module>plugins/sonar-i18n-plugin</module>
</modules>
<organization>
diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml
index da36b404335..6e83c28617d 100644
--- a/sonar-application/pom.xml
+++ b/sonar-application/pom.xml
@@ -209,12 +209,6 @@
<scope>runtime</scope>
</dependency>
<dependency>
- <groupId>org.codehaus.sonar.plugins</groupId>
- <artifactId>sonar-i18n-plugin</artifactId>
- <version>${project.version}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
<groupId>org.sonatype.jsw-binaries</groupId>
<artifactId>jsw-binaries</artifactId>
<version>3.2.3.6</version>
diff --git a/sonar-application/src/main/assembly/conf/logback.xml b/sonar-application/src/main/assembly/conf/logback.xml
index c11fca34b93..50b83f80122 100644
--- a/sonar-application/src/main/assembly/conf/logback.xml
+++ b/sonar-application/src/main/assembly/conf/logback.xml
@@ -103,7 +103,7 @@
<level value="INFO"/>
</logger>
- <logger name="org.sonar.plugins.i18n.I18nManager">
+ <logger name="org.sonar.plugins.core.i18n.I18nManager">
<level value="INFO"/>
</logger>
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java
index e8d698d2959..249c94b79b7 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java
@@ -42,6 +42,7 @@ import java.util.*;
public class BatchPluginRepository implements PluginRepository {
private static final Logger LOG = LoggerFactory.getLogger(BatchPluginRepository.class);
+ private static final String CORE_PLUGIN = "core";
private ArtifactDownloader artifactDownloader;
private Map<String, Plugin> pluginsByKey;
@@ -52,12 +53,12 @@ public class BatchPluginRepository implements PluginRepository {
public BatchPluginRepository(ArtifactDownloader artifactDownloader, Configuration configuration) {
this.artifactDownloader = artifactDownloader;
- if (configuration.getString(CoreProperties.INCLUDE_PLUGINS) != null) {
- whiteList = Sets.newTreeSet(Arrays.asList(configuration.getStringArray(CoreProperties.INCLUDE_PLUGINS)));
+ if (configuration.getString(CoreProperties.BATCH_INCLUDE_PLUGINS) != null) {
+ whiteList = Sets.newTreeSet(Arrays.asList(configuration.getStringArray(CoreProperties.BATCH_INCLUDE_PLUGINS)));
LOG.info("Include plugins: " + Joiner.on(", ").join(whiteList));
}
- if (configuration.getString(CoreProperties.EXCLUDE_PLUGINS) != null) {
- blackList = Sets.newTreeSet(Arrays.asList(configuration.getStringArray(CoreProperties.EXCLUDE_PLUGINS)));
+ if (configuration.getString(CoreProperties.BATCH_EXCLUDE_PLUGINS) != null) {
+ blackList = Sets.newTreeSet(Arrays.asList(configuration.getStringArray(CoreProperties.BATCH_EXCLUDE_PLUGINS)));
LOG.info("Exclude plugins: " + Joiner.on(", ").join(blackList));
}
// TODO reactivate somewhere else: LOG.info("Execution environment: {} {}", environment.getKey(), environment.getVersion());
@@ -124,6 +125,9 @@ public class BatchPluginRepository implements PluginRepository {
}
boolean isAccepted(String pluginKey) {
+ if (CORE_PLUGIN.equals(pluginKey)) {
+ return true;
+ }
if (whiteList != null) {
return whiteList.contains(pluginKey);
}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java
index 82bbf91ed33..00b291a2279 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java
@@ -118,7 +118,7 @@ public class BatchPluginRepositoryTest {
when(downloader.downloadPlugin(checkstyleExt)).thenReturn(copyFiles("sonar-checkstyle-extensions-plugin-0.1-SNAPSHOT.jar"));
PropertiesConfiguration conf = new PropertiesConfiguration();
- conf.setProperty(CoreProperties.EXCLUDE_PLUGINS, "checkstyle");
+ conf.setProperty(CoreProperties.BATCH_EXCLUDE_PLUGINS, "checkstyle");
repository = new BatchPluginRepository(downloader, conf);
repository.doStart(Arrays.asList(checkstyle, checkstyleExt));
@@ -149,17 +149,33 @@ public class BatchPluginRepositoryTest {
@Test
public void whiteListShouldTakePrecedenceOverBlackList() {
PropertiesConfiguration conf = new PropertiesConfiguration();
- conf.setProperty(CoreProperties.INCLUDE_PLUGINS, "checkstyle,pmd,findbugs");
- conf.setProperty(CoreProperties.EXCLUDE_PLUGINS, "cobertura,pmd");
+ conf.setProperty(CoreProperties.BATCH_INCLUDE_PLUGINS, "checkstyle,pmd,findbugs");
+ conf.setProperty(CoreProperties.BATCH_EXCLUDE_PLUGINS, "cobertura,pmd");
repository = new BatchPluginRepository(mock(ArtifactDownloader.class), conf);
assertThat(repository.isAccepted("pmd"), Matchers.is(true));
}
@Test
+ public void corePluginShouldAlwaysBeInWhiteList() {
+ PropertiesConfiguration conf = new PropertiesConfiguration();
+ conf.setProperty(CoreProperties.BATCH_INCLUDE_PLUGINS, "checkstyle,pmd,findbugs");
+ repository = new BatchPluginRepository(mock(ArtifactDownloader.class), conf);
+ assertThat(repository.isAccepted("core"), Matchers.is(true));
+ }
+
+ @Test
+ public void corePluginShouldNeverBeInBlackList() {
+ PropertiesConfiguration conf = new PropertiesConfiguration();
+ conf.setProperty(CoreProperties.BATCH_EXCLUDE_PLUGINS, "core,findbugs");
+ repository = new BatchPluginRepository(mock(ArtifactDownloader.class), conf);
+ assertThat(repository.isAccepted("core"), Matchers.is(true));
+ }
+
+ @Test
public void shouldCheckWhitelist() {
PropertiesConfiguration conf = new PropertiesConfiguration();
- conf.setProperty(CoreProperties.INCLUDE_PLUGINS, "checkstyle,pmd,findbugs");
+ conf.setProperty(CoreProperties.BATCH_INCLUDE_PLUGINS, "checkstyle,pmd,findbugs");
repository = new BatchPluginRepository(mock(ArtifactDownloader.class), conf);
assertThat(repository.isAccepted("checkstyle"), Matchers.is(true));
@@ -170,7 +186,7 @@ public class BatchPluginRepositoryTest {
@Test
public void shouldCheckBlackListIfNoWhiteList() {
PropertiesConfiguration conf = new PropertiesConfiguration();
- conf.setProperty(CoreProperties.EXCLUDE_PLUGINS, "checkstyle,pmd,findbugs");
+ conf.setProperty(CoreProperties.BATCH_EXCLUDE_PLUGINS, "checkstyle,pmd,findbugs");
repository = new BatchPluginRepository(mock(ArtifactDownloader.class), conf);
assertThat(repository.isAccepted("checkstyle"), Matchers.is(false));
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 e19a5a3f13b..01c652308cb 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
@@ -103,8 +103,8 @@ public interface CoreProperties {
String SERVER_STARTTIME = "sonar.core.startTime"; // format is yyyy-MM-dd'T'HH:mm:ssZ
String SKIP_TENDENCIES_PROPERTY = "sonar.skipTendencies";
boolean SKIP_TENDENCIES_DEFAULT_VALUE = false;
- String INCLUDE_PLUGINS = "sonar.includePlugins";
- String EXCLUDE_PLUGINS = "sonar.excludePlugins";
+ String BATCH_INCLUDE_PLUGINS = "sonar.includePlugins";
+ String BATCH_EXCLUDE_PLUGINS = "sonar.excludePlugins";
/* CPD */
String CPD_PLUGIN = "cpd";
diff --git a/sonar-server/pom.xml b/sonar-server/pom.xml
index 7d1fe84dcdc..5205ad689de 100644
--- a/sonar-server/pom.xml
+++ b/sonar-server/pom.xml
@@ -454,12 +454,6 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.codehaus.sonar.plugins</groupId>
- <artifactId>sonar-i18n-plugin</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
</dependencies>
</profile>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/i18n_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/i18n_controller.rb
new file mode 100644
index 00000000000..30ba45178db
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/i18n_controller.rb
@@ -0,0 +1,64 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2008-2011 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# Sonar is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 3 of the License, or (at your option) any later version.
+#
+# Sonar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with Sonar; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+#
+
+require "json"
+
+class I18nController < Api::ApiController
+
+ def index
+ render :text => "Use one of the following:<br><ul>" +
+ "<li>/i18n/unknown_keys?format=text|json</li>" +
+ "</ul>"
+ end
+
+ #
+ # GET /i18n/unknown_keys
+ #
+ def unknown_keys
+ begin
+ output = ""
+ properties = i18n_manager.unknown_keys
+
+ properties.keys.sort.each {|key| output += "#{key}=#{properties[key]}\n" }
+
+ output = "# No unknown keys" if output.empty?
+
+ respond_to do |format|
+ format.json { render :json => JSON(properties) }
+ format.xml { render :xml => xml_not_supported }
+ format.text { render :text => output }
+ end
+
+ rescue ApiException => e
+ render_error(e.msg, e.code)
+
+ rescue Exception => e
+ logger.error("Fails to execute #{request.url} : #{e.message}")
+ render_error(e.message)
+ end
+ end
+
+ private
+
+ def i18n_manager
+ java_facade.getComponentByClassname('i18n', 'org.sonar.plugins.core.i18n.I18nManager')
+ end
+
+end \ No newline at end of file