aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-runner-batch/src/main/java/org
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2015-06-26 11:03:53 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2015-06-26 11:03:53 +0200
commit244f5ea57e9a0b11408cfff45391d8ea4585e94e (patch)
treec263ae33d1e8f63fddbb1f5705c2275f5f288188 /sonar-runner-batch/src/main/java/org
parent404e53a9a72a4dedb9d328f4a3bbebd69759511a (diff)
downloadsonar-scanner-cli-244f5ea57e9a0b11408cfff45391d8ea4585e94e.tar.gz
sonar-scanner-cli-244f5ea57e9a0b11408cfff45391d8ea4585e94e.zip
Restore compatibility with SQ before 5.2
Diffstat (limited to 'sonar-runner-batch/src/main/java/org')
-rw-r--r--sonar-runner-batch/src/main/java/org/sonar/runner/batch/BatchIsolatedLauncher.java11
-rw-r--r--sonar-runner-batch/src/main/java/org/sonar/runner/batch/Compatibility.java42
2 files changed, 44 insertions, 9 deletions
diff --git a/sonar-runner-batch/src/main/java/org/sonar/runner/batch/BatchIsolatedLauncher.java b/sonar-runner-batch/src/main/java/org/sonar/runner/batch/BatchIsolatedLauncher.java
index 8723ed8..4241da4 100644
--- a/sonar-runner-batch/src/main/java/org/sonar/runner/batch/BatchIsolatedLauncher.java
+++ b/sonar-runner-batch/src/main/java/org/sonar/runner/batch/BatchIsolatedLauncher.java
@@ -29,7 +29,6 @@ import java.util.Properties;
import org.picocontainer.annotations.Nullable;
import org.sonar.batch.bootstrapper.Batch;
import org.sonar.batch.bootstrapper.EnvironmentInformation;
-import org.sonar.batch.bootstrapper.LogOutput;
/**
* This class is executed within the classloader provided by the server. It contains the installed plugins and
@@ -62,14 +61,8 @@ public class BatchIsolatedLauncher implements IsolatedLauncher {
.setBootstrapProperties((Map) properties);
if (logOutput != null) {
- builder.setLogOutput(new LogOutput() {
-
- @Override
- public void log(String formattedMessage, Level level) {
- logOutput.log(formattedMessage, org.sonar.runner.batch.LogOutput.Level.valueOf(level.name()));
- }
-
- });
+ // Do that is a separate class to avoid NoClassDefFoundError for org/sonar/batch/bootstrapper/LogOutput
+ Compatibility.setLogOutputFor5dot2(builder, logOutput);
}
return builder.build();
diff --git a/sonar-runner-batch/src/main/java/org/sonar/runner/batch/Compatibility.java b/sonar-runner-batch/src/main/java/org/sonar/runner/batch/Compatibility.java
new file mode 100644
index 0000000..88dd0c9
--- /dev/null
+++ b/sonar-runner-batch/src/main/java/org/sonar/runner/batch/Compatibility.java
@@ -0,0 +1,42 @@
+/*
+ * SonarQube Runner - Batch
+ * Copyright (C) 2011 SonarSource
+ * dev@sonar.codehaus.org
+ *
+ * This program 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.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.runner.batch;
+
+import org.sonar.batch.bootstrapper.Batch;
+import org.sonar.batch.bootstrapper.LogOutput;
+
+public class Compatibility {
+
+ private Compatibility() {
+ // Utility class
+ }
+
+ static void setLogOutputFor5dot2(Batch.Builder builder, final org.sonar.runner.batch.LogOutput logOutput) {
+ builder.setLogOutput(new LogOutput() {
+
+ @Override
+ public void log(String formattedMessage, Level level) {
+ logOutput.log(formattedMessage, org.sonar.runner.batch.LogOutput.Level.valueOf(level.name()));
+ }
+
+ });
+ }
+
+}