import org.sonar.api.SonarRuntime;
import org.sonar.api.internal.MetadataLoader;
import org.sonar.api.internal.SonarRuntimeImpl;
+import org.sonar.api.notifications.AnalysisWarnings;
import org.sonar.api.utils.MessageException;
import org.sonar.api.utils.System2;
import org.sonar.api.utils.UriReader;
import org.sonar.core.extension.CoreExtensionRepositoryImpl;
import org.sonar.core.extension.CoreExtensionsLoader;
import org.sonar.core.platform.ComponentContainer;
+import org.sonar.core.platform.PluginClassLoader;
import org.sonar.core.platform.PluginClassloaderFactory;
import org.sonar.core.platform.PluginInfo;
-import org.sonar.core.platform.PluginClassLoader;
import org.sonar.core.platform.PluginRepository;
import org.sonar.core.util.DefaultHttpDownloader;
import org.sonar.core.util.UuidFactoryImpl;
import org.sonar.scanner.extension.ScannerCoreExtensionsInstaller;
+import org.sonar.scanner.notifications.DefaultAnalysisWarnings;
import org.sonar.scanner.platform.DefaultServer;
import org.sonar.scanner.repository.DefaultMetricsRepositoryLoader;
import org.sonar.scanner.repository.DefaultNewCodePeriodLoader;
addBootstrapComponents();
}
- private static void checkJavaVersion() {
+ private static void checkJavaVersion(AnalysisWarnings analysisWarnings) {
try {
String.class.getMethod("isBlank");
} catch (NoSuchMethodException e) {
- LOG.warn("SonarScanner will require Java 11 to run starting in SonarQube 9.x");
+ LOG.warn("SonarScanner will require Java 11 to run, starting in SonarQube 9.x");
+ analysisWarnings.addUnique("SonarScanner will require Java 11 to run, starting in SonarQube 9.x. Please upgrade the version of Java that executes the scanner.");
}
}
private void addBootstrapComponents() {
Version apiVersion = MetadataLoader.loadVersion(System2.INSTANCE);
SonarEdition edition = MetadataLoader.loadEdition(System2.INSTANCE);
+ DefaultAnalysisWarnings analysisWarnings = new DefaultAnalysisWarnings(System2.INSTANCE);
if (edition != SonarEdition.SONARCLOUD) {
- checkJavaVersion();
+ checkJavaVersion(analysisWarnings);
}
LOG.debug("{} {}", edition.getLabel(), apiVersion);
add(
DefaultServer.class,
new GlobalTempFolderProvider(),
DefaultHttpDownloader.class,
+ analysisWarnings,
UriReader.class,
PluginFiles.class,
System2.INSTANCE,
import org.sonar.scanner.issue.ignore.pattern.IssueInclusionPatternInitializer;
import org.sonar.scanner.issue.ignore.scanner.IssueExclusionsLoader;
import org.sonar.scanner.mediumtest.AnalysisObservers;
-import org.sonar.scanner.notifications.DefaultAnalysisWarnings;
import org.sonar.scanner.postjob.DefaultPostJobContext;
import org.sonar.scanner.postjob.PostJobOptimizer;
import org.sonar.scanner.postjob.PostJobsExecutor;
ContextPropertiesCache.class,
ContextPropertiesPublisher.class,
- DefaultAnalysisWarnings.class,
-
SensorStrategy.class,
MutableProjectSettings.class,