-1

I am trying use sonarqube with cloudbuild but i am getting error "Your project contains .java files, please provide compiled classes with sonar.java.binaries property" my cloubuild.yaml file are below.

 - id: 'Sonarqube' 
name: 'gcr.io/{project-id}/testt:latest'
args:
- '-Dsonar.host.url={url}'
- '-Dsonar.login={login}'
- '-Dsonar.projectKey=m{key}'
- '-Dsonar.qualitygate.wait=true'
- '-Dsonar.sources=.'
  • id: 'build your instance' name: 'maven:3-jdk-8' entrypoint: mvn args: ['clean','package']
Abhinav
  • 71
  • 1
  • 9

2 Answers2

1

The error message is pretty clear. Don't change any of the existing properties, but add a setting for "sonar.java.binaries=target".

David M. Karr
  • 14,317
  • 20
  • 94
  • 199
0

As said in the comment, and in relation with the error, sonarqube use only compiled files. Use the ./target dir (which contains .class compiled files) instead of the root dir (which contains not compiled Java files.

guillaume blaquiere
  • 66,369
  • 2
  • 47
  • 76