Skip to content

Commit 4d44809

Browse files
dbmenesesjacek-poreda-sonarsource
authored andcommitted
SONARGRADL-66 Make SONAR_HOST_URL environment variable known Gradle S… (#62)
* Make SONAR_HOST_URL environment variable known Gradle Scanner
1 parent 793a4f2 commit 4d44809

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ repositories {
7272

7373
dependencies {
7474
compile gradleApi()
75-
compile 'org.sonarsource.scanner.api:sonar-scanner-api:2.12.0.1661'
75+
compile 'org.sonarsource.scanner.api:sonar-scanner-api:2.14.0.2002'
7676
compileOnly 'com.android.tools.build:gradle:3.1.0'
7777
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
7878
testCompile localGroovy()

integrationTests/src/test/java/org/sonarqube/gradle/GradleTest.java

+11
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ public void testSkip() throws Exception {
7272
assertThat(result.getLog()).contains("SonarQube Scanner analysis skipped");
7373
}
7474

75+
@Test
76+
public void testHostUrlInEnv() throws Exception {
77+
Map<String, String> env = new HashMap<>();
78+
env.put("SONAR_HOST_URL", "http://host-in-env");
79+
RunResult result = runGradlewSonarQubeWithEnvQuietly("/java-gradle-simple", env);
80+
81+
System.out.println(result.getLog());
82+
assertThat(result.getExitValue()).isEqualTo(1);
83+
assertThat(result.getLog()).contains("java.net.UnknownHostException: host-in-env");
84+
}
85+
7586
@Test
7687
public void testCompileOnly() throws Exception {
7788
Properties props = runGradlewSonarQubeSimulationMode("/java-compile-only");

0 commit comments

Comments
 (0)