Is it possible to configure the `sonarqube` gradle task to let using more than one gradle worker?

My organization uses the org.sonarsource.scanner.gradle:sonarqube-gradle-plugin: to run the sonarqube task and publish the results to Sonarqube Data Center Edition Version 9.8 (build 63668).

We run the sonarqube task on our CI. The project is quite large, so it takes between 20 and 30 minutes to complete, and currently, it’s the main contributor to the CI running time.

An analysis of the Gradle task has shown that the main issue with the task is that it uses a single Gradle worker (i.e., only one thread) to perform the analysis. Essentially, the task is not scalable and cannot effectively process large projects.

I’ve searched on, but it doesn’t seem to provide any information on this issue.

Has anyone found a solution for this?

Hey there.

It’s not possible to run more than one task against a project at once.

And –

  • Make sure that you’re using the latest version of the Scanner for Gradle, v4.3.1
  • Make sure you’re using a supported version of SonarQube, at least v9.9 LTS
  • As a Data Center Edition user, you have access to SonarSource’s commercial support if you want to address any specific performance issues.

No, it’s not possible to run more than one task against a project. However, it’s possible to run multiple parallel tasks against subprojects that are part of a (root) project. Another possibility is to employ the Gradle Worker API, although this requires support from the plugin developers.

:thinking: It doesn’t resolve the issue, does it? Otherwise, why isn’t it offered as a solution? P.S. v4.+ requires Java 17 and isn’t compatible with our current setup. But I would consider upgrading the Java version if I were sure it would resolve the issue.

Thanks Colin. I should do that.