Hi,
I want to set up the config for SonarQube as an init.gradle script on our CI server so that not every build.gradle needs the sonarrunner-tasks with its properties.
So I have created the following init.gradle file:
initscript {
apply plugin: "sonar-runner"
allprojects {
sonarRunner {
sonarProperties {
property "sonar.host.url", SONARQUBE_HOST_URL
property "sonar.jdbc.url", SONARQUBE_JDBC_URL
....
}
}
}
But when I try to execute it using “gradlew tasks” I get the following error:
- What went wrong: A problem occurred evaluating initialization script. > Failed to apply plugin [id ‘sonar-runner’]
org.gradle.invocation.DefaultGradle_Decorated cannot be cast to org.gradle.api.Project
How can I set up the sonarrunner plugin in an init.gradle file on my CI-server?