]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
SCANCLI-145 Update to the latest build
authorJulien HENRY <julien.henry@sonarsource.com>
Fri, 3 May 2024 09:28:33 +0000 (11:28 +0200)
committerJulien HENRY <julien.henry@sonarsource.com>
Fri, 3 May 2024 11:07:43 +0000 (13:07 +0200)
it/pom.xml
it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java
pom.xml
src/main/java/org/sonarsource/scanner/cli/Main.java
src/main/java/org/sonarsource/scanner/cli/ScannerEngineBootstrapperFactory.java
src/test/java/org/sonarsource/scanner/cli/MainTest.java

index 71da0cc8bf8a3eab702bde196011b4dbf7692d80..2ad29b742746c25b8a7199bda7abd230f18123d9 100644 (file)
@@ -62,7 +62,7 @@
     <dependency>
       <groupId>org.assertj</groupId>
       <artifactId>assertj-core</artifactId>
-      <version>3.12.2</version>
+      <version>3.24.2</version>
     </dependency>
   </dependencies>
 
index 899c03c3a812c9575cd6ee79d63c6cd5aef988f6..9129ce22cf864042f6eedcbe568d252e238604e0 100644 (file)
@@ -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 5fe78e5bf68028411eaeca1717317dc24b9cc30f..7fbf29b5cebf2fb69f67c55b8cccf53c08771606 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -66,7 +66,7 @@
     <dependency>
       <groupId>org.sonarsource.scanner.lib</groupId>
       <artifactId>sonar-scanner-java-library</artifactId>
-      <version>3.0.0.76</version>
+      <version>3.0.0.114</version>
     </dependency>
     <dependency>
       <groupId>com.google.code.findbugs</groupId>
             <configuration>
               <rules>
                 <requireFilesSize>
-                  <minsize>3000000</minsize>
-                  <maxsize>3100000</maxsize>
+                  <minsize>3400000</minsize>
+                  <maxsize>3500000</maxsize>
                   <files>
                     <file>${project.build.directory}/sonar-scanner-${project.version}.zip</file>
                   </files>
index 8ad0c051f5528735d1e9f46e348dea738fc3344c..0da03aa957d15d24d46444ed55d94b84d6f976d8 100644 (file)
@@ -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);
     }
index b67254c642f9880c6e025f4010895c39c5526da4..f9e7fe73dd563f9cc0dcb1b97856c9e1eb053a11 100644 (file)
@@ -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());
   }
 
 
index 5d4a372c876bce583c4bad73cfb188a965e11c24..7a2156bb090864fabb9472a563d601e29086fa03 100644 (file)
@@ -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("");