Reputation: 311
we are pretty much impressed with working of sonarqube with Java projects and planning to go for next level by analyzing Android projects. we have Sonarqube version-5.6.6
and gradle-2.8
. Below is my configuration added for our android projects build.gradle.
dependencies {
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.1"
}
sonar {
server {
url = "http:sonar-url.com"
}
}
apply plugin: "sonar"
this is issue popping up when I run gradle sonar
Could not find method sonar() for arguments [build_2gg1yf48v6l7ngh099813mf0i$_run_closure1$_closure4@61d34b4] on root project 'project name'.
Upvotes: 0
Views: 10929
Reputation: 4754
Hi i am curious why you decided to use an outdated plugin version, when you just start your gradle implementation. At SonarQube Gradle Plugin Doc you find a detailed description how to actually use it.
Generally speaking for the new Gradle version, you need to:
eg.
dependencies {
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.5'
}
apply plugin: 'org.sonarqube'
sonarqube {
properties {
property "sonar.host.url", "http://sonarserver.com"
}
}
and you run it with:
gradle sonarqube
Additional notes:
property "sonar.host.url", "http://sonarserver.com"
. In my project i strangly set just this property with System.setProperty("sonar.host.url", "<sonar-url>")
. I do not know why, but i am sure there is a reason for that, and i want to let you know this.Upvotes: 4