Found multiple 'report-task.txt' when analysing single project on multi-project build

Hi,

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:

./gradlew sonarqube -p backend
./gradlew sonarqube -p frontend

After the second command, I get this message:

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.

Versions used:

  • SonarQube: 7.3
  • Sonarqube Gradle Plugin: 3.0
  • Gradle: 6.5.1 (Gradle Wrapper)

Thanks in advance!

Regards,

Rodrigo

Hi @rcsilva83

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.

There is known limitation in the Jenkins plugin regarding supporting multiple analysis in a single pipeline, see https://jira.sonarsource.com/browse/SONARJNKNS-316

Cheers,
Mark

Hi @Mark_Rekveld

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.

Regards,

Rodrigo