]> source.dussan.org Git - sonarqube.git/commitdiff
Simplify usage of sonar-ws-generator
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 4 Dec 2017 14:33:35 +0000 (15:33 +0100)
committerDaniel Schwarz <bartfastiel@users.noreply.github.com>
Wed, 6 Dec 2017 13:40:17 +0000 (14:40 +0100)
sonar-ws-generator/run.sh
sonar-ws-generator/src/main/java/org/sonarqube/wsgenerator/ApiDefinitionDownloader.java

index 71d3af84b584796d2f4cbde5d5c4e240416ff838..58b77a09c44b8722c451f90071edbbfd40d3d8ca 100755 (executable)
@@ -6,5 +6,5 @@
 set -euo pipefail
 
 mvn clean package -Prun-ws-generator
-java -Dorchestrator.configUrl=file://$* -jar target/sonar-ws-generator-*-SNAPSHOT-jar-with-dependencies.jar
+java -jar target/sonar-ws-generator-*-SNAPSHOT-jar-with-dependencies.jar
 cp -R target/generated-sources/results/org/sonarqube/ws/client/* ../sonar-ws/src/main/java/org/sonarqube/ws/client
index 2d8259db71a5f8589d194176c674d914073ef76a..ca05435222bc2c73cf65dd162288202e3f082375 100644 (file)
@@ -22,6 +22,8 @@ package org.sonarqube.wsgenerator;
 import com.sonar.orchestrator.Orchestrator;
 import com.sonar.orchestrator.http.HttpCall;
 import com.sonar.orchestrator.http.HttpResponse;
+import com.sonar.orchestrator.locator.FileLocation;
+import java.io.File;
 
 public class ApiDefinitionDownloader {
 
@@ -30,13 +32,9 @@ public class ApiDefinitionDownloader {
   }
 
   public static String downloadApiDefinition() {
-    String orchestratorUrl = System.getProperty("orchestrator.configUrl");
-    if (orchestratorUrl == null) {
-      throw new IllegalStateException("Please run with -Dorchestrator.configUrl=file:///path/to/your/orchestrator.properties");
-    }
     Orchestrator orchestrator = Orchestrator
       .builderEnv()
-      .setSonarVersion("DEV")
+      .setZipFile(FileLocation.byWildcardMavenFilename(new File("../sonar-application/target"), "sonarqube-*.zip").getFile())
       .build();
 
     orchestrator.start();