We have a multi-project gradle build, which organizes the projects into directories. Example:
root
+--Libraries
+-- Project1
+-- Project2
+--Tools
+-- Project3
+-- Project4
Since the SonarRunner plugin is deprecated, we have attempted to use the official SonarQube plugin for gradle. The gradle version used is 2.10.
Due to our project structure, there are problems with the project names: SonarQube plugin receives projects names "Libraries\Project1". "\" is an illegal character for a project name.
Previously, for SonarRunner, the problem was fixed by overriding the ProjectKey property:
// project specific sonar configuration
gradle.projectsEvaluated {
subprojects {
sonarRunner {
sonarProperties {
def projectKey = "$project.group:$project.name".replaceAll('/', '-')
property 'sonar.projectKey', projectKey
}
}
}
}
The equivalent tried for SonarQube is
// project specific sonar configuration
gradle.projectsEvaluated {
subprojects {
sonarqube{
properties {
def projectKey = "$project.group:$project.name".replaceAll('/', '-')
property 'sonar.projectKey', projectKey
}
}
}
}
However, this doesn't work with SonarQube. Has anyone encountered a similar problem?
Thanks for your help!