问题
I have integrated SonarQube via Jenkins for various applications. We have separate visual studio solutions for different applications. Somehow SonarQube combines analysis report for various applications under a single report.
How can I generate separate report for each application? I have the following properties to run Sonar analysis via Jenkins.
sonar.projectKey=SONAR_TEST
sonar.projectName=SONAR_TEST
sonar.projectVersion=1.0
sonar.sources=C:/$Application_Name (Note: $Application_Name is root folder name of various applications)
sonar.host.url=https://server_name:8080/sonar/
回答1:
The reason it is aggregating the reports is because you are telling it to.
SonarQube results are displayed by "Project", based on projectKey. You appear to be setting the same fixed projectKey(and projectName) for every job.
sonar.projectKey=SONAR_TEST
sonar.projectName=SONAR_TEST
sonar.sources=C:/$Application_Name
Change the projectKey(and projectName) to align with the "$Application_Name
" (and give the projectName a user friendly name if you like). Omitting the projectName defaults to the projectKey.
By default, if a maven project, the project is the GroupId:ArtifactID. Other types do not have a default key, but you can generally use similar logic to align.
You can enter this information in a sonar-project.properties file inside your root folder (ie: $Application_Name/sonar-project.properties
)
Note: Key cannot have spaces, Name can.
来源:https://stackoverflow.com/questions/65123613/sonarqube-combines-analysis-report-of-various-applications-under-a-single-report