From 6ffdbb689027f9458a06c28c260bf33570e52434 Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Fri, 3 May 2024 11:28:33 +0200 Subject: [PATCH] SCANCLI-145 Update to the latest build --- it/pom.xml | 2 +- .../java/com/sonarsource/scanner/it/ScannerTest.java | 10 ++++++++-- pom.xml | 6 +++--- src/main/java/org/sonarsource/scanner/cli/Main.java | 4 ++-- .../scanner/cli/ScannerEngineBootstrapperFactory.java | 2 +- .../java/org/sonarsource/scanner/cli/MainTest.java | 4 ++-- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/it/pom.xml b/it/pom.xml index 71da0cc..2ad29b7 100644 --- a/it/pom.xml +++ b/it/pom.xml @@ -62,7 +62,7 @@ org.assertj assertj-core - 3.12.2 + 3.24.2 diff --git a/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java b/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java index 899c03c..9129ce2 100644 --- a/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java +++ b/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java @@ -188,7 +188,10 @@ public class ScannerTest extends ScannerTestCase { assertThat(buildResult.isSuccess()).isFalse(); assertThat(buildResult.getLogs()) - .contains("SonarQube server [http://from-env.org] can not be reached"); + .containsAnyOf( + "No such host is known (from-env.org)", // Windows + "from-env.org: Name or service not known" // Linux + ); } @Test @@ -214,7 +217,10 @@ public class ScannerTest extends ScannerTestCase { assertThat(result.isSuccess()).isFalse(); // with the following message assertThat(result.getLogs()) - .contains("SonarQube server [http://foo] can not be reached"); + .containsAnyOf( + "No such host is known (foo)", // Windows + "foo: No address associated with hostname" // Linux + ); } // SONARPLUGINS-3574 diff --git a/pom.xml b/pom.xml index 5fe78e5..7fbf29b 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ org.sonarsource.scanner.lib sonar-scanner-java-library - 3.0.0.76 + 3.0.0.114 com.google.code.findbugs @@ -188,8 +188,8 @@ - 3000000 - 3100000 + 3400000 + 3500000 ${project.build.directory}/sonar-scanner-${project.version}.zip diff --git a/src/main/java/org/sonarsource/scanner/cli/Main.java b/src/main/java/org/sonarsource/scanner/cli/Main.java index 8ad0c05..0da03aa 100644 --- a/src/main/java/org/sonarsource/scanner/cli/Main.java +++ b/src/main/java/org/sonarsource/scanner/cli/Main.java @@ -21,9 +21,9 @@ package org.sonarsource.scanner.cli; import java.util.Map; import java.util.Properties; -import org.sonarsource.scanner.lib.ScanProperties; import org.sonarsource.scanner.lib.ScannerEngineBootstrapper; import org.sonarsource.scanner.lib.ScannerEngineFacade; +import org.sonarsource.scanner.lib.ScannerProperties; /** * Arguments : @@ -96,7 +96,7 @@ public class Main { } private void checkSkip(Properties properties) { - if ("true".equalsIgnoreCase(properties.getProperty(ScanProperties.SKIP))) { + if ("true".equalsIgnoreCase(properties.getProperty(ScannerProperties.SKIP))) { logger.info("SonarScanner CLI analysis skipped"); exit.exit(Exit.SUCCESS); } diff --git a/src/main/java/org/sonarsource/scanner/cli/ScannerEngineBootstrapperFactory.java b/src/main/java/org/sonarsource/scanner/cli/ScannerEngineBootstrapperFactory.java index b67254c..f9e7fe7 100644 --- a/src/main/java/org/sonarsource/scanner/cli/ScannerEngineBootstrapperFactory.java +++ b/src/main/java/org/sonarsource/scanner/cli/ScannerEngineBootstrapperFactory.java @@ -44,7 +44,7 @@ class ScannerEngineBootstrapperFactory { } ScannerEngineBootstrapper newScannerEngineBootstrapper(String appName, String appVersion) { - return new ScannerEngineBootstrapper(appName, appVersion, logger.getLogOutputAdapter()); + return ScannerEngineBootstrapper.create(appName, appVersion, logger.getLogOutputAdapter()); } diff --git a/src/test/java/org/sonarsource/scanner/cli/MainTest.java b/src/test/java/org/sonarsource/scanner/cli/MainTest.java index 5d4a372..7a2156b 100644 --- a/src/test/java/org/sonarsource/scanner/cli/MainTest.java +++ b/src/test/java/org/sonarsource/scanner/cli/MainTest.java @@ -29,9 +29,9 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.sonar.api.utils.MessageException; -import org.sonarsource.scanner.lib.ScanProperties; import org.sonarsource.scanner.lib.ScannerEngineBootstrapper; import org.sonarsource.scanner.lib.ScannerEngineFacade; +import org.sonarsource.scanner.lib.ScannerProperties; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; @@ -221,7 +221,7 @@ public class MainTest { @Test public void should_skip() { Properties p = new Properties(); - p.setProperty(ScanProperties.SKIP, "true"); + p.setProperty(ScannerProperties.SKIP, "true"); when(conf.properties()).thenReturn(p); when(cli.getInvokedFrom()).thenReturn(""); -- 2.39.5