Problem with sonar Gradle scanner and Gradle 8

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    →, gradle scanner
  • how is SonarQube deployed: zip, Docker, Helm
    → container
  • what are you trying to achieve
    → migrate the build to Gradle 8.x
  • what have you tried so far to achieve this
    → updated the Gradle scanner and Gradle itself

Hi, when using Gradle 8.0.2 and sonar scanner for Gradle I am experiencing the following problem with a multi-project build:

Execution failed for task ':sonar'.
> The base directory of the module ':x.y.z.documentation' does not exist: /build/workspaces/egr-analyze-1.0/:x.y.z.documentation

* Try:
> Run with --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':sonar'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(
	at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(

Notice the colon in the path that should not be there.

I found this topic ( but it seems as if the source code has changed since then.

Hey there.

Thanks for the report.

Is skipProject or any other sonar-specific configuration configured for the module ':x.y.z.documentatio`

No, there is no project specific setting in one of the sub-projects.

I just noticed the comments in [SONARGRADL-109] - Jira
I will try to switch to using sonar instead of sonarqube extension / configuration in Gradle.

Documentation (SonarScanner for Gradle) is still using old / deprecated way it seems. This is quite confusing. I noticed that there is a sonar task now but nothing about a new config extension.

I need to correct myself. skipProject is used.

The problem does not appear if the new task is used AND also the new configuration block (both named sonar).
The documentation should be using the new names too I guess. Maybe removing the old things instead of deprecating them would even be better. It is just a small change to make as user of the plugin.

Hi @Thomas_Hofmann, thanks for pointing this out.
I made a ticket for the Documentation team to investigate further and update the docs.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.