Sonar-scanner-gradle 9.1.0 Error when combining "clean" and "sonar" tasks in one line

Hi,

Using Gradle 9.1.0 and Scanner plugin 7.0.0.6105 on a multi-module project.

Doing a “./gradlew clean build sonar” end with an error, whereas just “build sonar” or “clean build” succeeds.

  • ALM: Bitbucket
  • CI system used: Bitbucket pipelines
  • Scanner command used: ./gradlew clean build sonar
  • Languages of the repository: Java, Gradle 9.1.0
  • The URL: Bitbucket
  • Error observed:
./gradlew clean build sonar
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':application:sonarResolver'.
> java.io.IOException: No such file or directory

  • Steps to reproduce
    • Clone repository
    • Run ./gradlew clean build sonar
  • Potential workaround: Run ‘clean’ task separately or not run it at all (since it runs in CI)

I realize that in a CI env one doesn’t need to run “clean”, but this is like a second nature, and the issue makes for unpleasant upgrade experience as I wish to upgrade an older project to Gradle 9.1.0

The sample repository is just a Gradle example of how to use Jacoco on a multi-project build, with me adding Sonar in a following commit (perhaps in the wrong way…)

Thanks,

Uri

1 Like

Hi @uriv58,
Thanks for the feedback. I was able to reproduce the issue with the resolver task by running ./gradlew clean sonar. We will follow up soon with a ticket to investigate the issue.

Cheers,

Dorian

Is there any solution for this? We are facing the same issue after upgrading the sonarqube plugin version. Using gradle 8.14.3 or 9.1.0 result in same error.

We have updated from 6.2.0.5505 to 7.0.1.6134

Hi @uriv58 and @AD3NDST_deere,
Here is the ticket. It should be tackled in the next release.

Cheers,

Dorian