Mvn clean verify sonar:sonar: No such file or directory error with CloudBuild

  • Sonarqube: Developer Edition 9.3.0.51899
  • Cloud Build trigger:
    source:
    repoSource:
    repoName: – my repo name in bitbucket cloud –
    branchName: develop
    steps:
    • name: ‘Google Cloud Platform
      env:
      • ‘SONAR_HOST_URL=${_SONAR_HOST_URL}’
      • ‘SONAR_LOGIN=${_SONAR_LOGIN}’
        args:
      • ‘mvn clean verify sonar:sonar’
      • ‘-Dsonar.projectKey=
      • ‘-Dsonar.sources=.’
      • ‘-Dsonar.qualitygate.wait=true allow_failure: true’
        id: sonarqube
        entrypoint: sh

but launching the Cloud Build trigger I get the following error:
sh: mvn clean verify sonar:sonar: No such file or directory

Hey there.

This is probably out of scope for our community (unless it’s all working perfectly until you add SonarQube related bits).

Looking at the documentation for the docker image, you should probably revisit your YAML file. The examples don’t seem to match what you’re providing. cloud-builders/mvn at master · GoogleCloudPlatform/cloud-builders · GitHub