aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2019-05-14 16:02:43 -0500
committerSonarTech <sonartech@sonarsource.com>2019-05-16 20:21:08 +0200
commit74cbdd7c043e8e9ee51d7c18aeef86db386df136 (patch)
tree480cb1cca1765b6a0d985cb754de31d325604a4e /sonar-scanner-engine
parent9240dd9a15b317d94c1db5c94281398a16b2b36a (diff)
downloadsonarqube-74cbdd7c043e8e9ee51d7c18aeef86db386df136.tar.gz
sonarqube-74cbdd7c043e8e9ee51d7c18aeef86db386df136.zip
SONAR-12108 Support Java 11 RTE
Diffstat (limited to 'sonar-scanner-engine')
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java
index 690509a8daa..9b407ba2a3d 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java
@@ -22,10 +22,10 @@ package org.sonar.scanner.bootstrap;
import java.time.Clock;
import java.util.List;
import java.util.Map;
-import org.sonar.api.SonarEdition;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.CoreProperties;
import org.sonar.api.Plugin;
+import org.sonar.api.SonarEdition;
import org.sonar.api.SonarQubeSide;
import org.sonar.api.SonarQubeVersion;
import org.sonar.api.internal.MetadataLoader;
@@ -78,9 +78,20 @@ public class GlobalContainer extends ComponentContainer {
addBootstrapComponents();
}
+ private static void checkJavaVersion() {
+ try {
+ String.class.getMethod("isBlank");
+ } catch (NoSuchMethodException e) {
+ LOG.warn("SonarQube scanners will require Java 11+ starting on next version");
+ }
+ }
+
private void addBootstrapComponents() {
Version apiVersion = MetadataLoader.loadVersion(System2.INSTANCE);
SonarEdition edition = MetadataLoader.loadEdition(System2.INSTANCE);
+ if (edition != SonarEdition.SONARCLOUD) {
+ checkJavaVersion();
+ }
LOG.debug("{} {}", edition.getLabel(), apiVersion);
add(
// plugins