I have a multi-project Gradle build with projects “frontend” and “backend”. As we have different quality profiles for each one, we run the analysis for each sub-project separately like this:
WARN: Found multiple 'report-task.txt' in the workspace. Taking the first one.
backend/build/sonar/report-task.txt
frontend/build/sonar/report-task.txt
In this case, the frontend analysis executed after the backend one will get the backend report (the first in the list)! As a workaround, I simply inverted the analysis order but I think the Sonarqube plugin should respect the “-p” build parameter to get the correct report-task.txt.
I suspect that you get the warning message on your Jenkins system.
This because the warning that there are multiple report-task.txt file is something the Jenkins SonarQube plugin will report on, but the Gradle plugin doesn’t.
Thanks for your response! Actually we don’t use Jenkins plugin to analyse the code and this problem also happens when I run locally.
I know the main problem is having 2 separate analisys on the same project but this was the only solution we found to have different code coverage rules for frontend and backend.