From 6354fe3096b07caf9eb017ab7b4e0565f6d303fc Mon Sep 17 00:00:00 2001 From: Matteo Mara Date: Tue, 5 Jul 2022 15:52:26 +0200 Subject: SONAR-16567 add an analysis warning when using a token expiring in less than 7 days. --- .../java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java') diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java index 8e86aa8b0b4..7a45f5cc35a 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java @@ -20,6 +20,7 @@ package org.sonar.scanner.bootstrap; import org.sonar.api.CoreProperties; +import org.sonar.api.notifications.AnalysisWarnings; import org.sonar.api.utils.System2; import org.sonar.batch.bootstrapper.EnvironmentInformation; import org.sonarqube.ws.client.HttpConnector; @@ -37,7 +38,7 @@ public class ScannerWsClientProvider { @Bean("DefaultScannerWsClient") public DefaultScannerWsClient provide(ScannerProperties scannerProps, EnvironmentInformation env, GlobalAnalysisMode globalMode, - System2 system) { + System2 system, AnalysisWarnings analysisWarnings) { String url = defaultIfBlank(scannerProps.property("sonar.host.url"), "http://localhost:9000"); HttpConnector.Builder connectorBuilder = HttpConnector.newBuilder(); @@ -58,6 +59,6 @@ public class ScannerWsClientProvider { } return new DefaultScannerWsClient(WsClientFactories.getDefault().newClient(connectorBuilder.build()), login != null, - globalMode); + globalMode, analysisWarnings); } } -- cgit v1.2.3