Cannot use -Dsonar.qualitygate.wait=true with CloudBuild

Hey all,

I’m trying to use SonarQube with CloudBuild on GCP.

The error seems suggesting “-Dsonar.qualitygate.wait=true” isn’t a valid option, where did I go wrong?

  • Here is my CloudBuild.yaml

    • id: ‘Maven build’
      name: Google Cloud Platform
      entrypoint: sh
      • ‘-c’
      • |
        mvn clean verify sonar:sonar
  • Here is the error message
    [line 6: -Dsonar.qualitygate.wait=true: command not found]

  • Sonarqube Server Version
    [INFO] SonarQube version: 9.1.0


Welcome to the community!

Maven seems to be taking that parameter as a separate command. Have you posted your exact syntax? Could there be some odd characters in there? Maybe put everything on one line?