I run a Sonar analysis, using sonar-scanner
installed on my workstation:
sonar-scanner -Dsonar.host.url=<SONARQUBE_URL> -Dsonar.login=<TOKEN> -Dsonar.projectKey=<SOME_KEY> -Dsonar.java.binaries=target/classes
Everything runs fine. In particuler, the scanner finds 30 source files to analyse.
I run the same Sonar analysis, using the Docker sonar-scanner-cli
image:
(winpty) docker run --rm -e SONAR_HOST_URL=<SONARQUBE_URL> -e SONAR_TOKEN=<TOKEN> -e SONAR_SCANNER_OPTS="-Dsonar.projectKey=<SOME_KEY> -Dsonar.java.binaries=target/classes" -v `pwd`:/usr/src sonarsource/sonar-scanner-cli:4.8.0
It runs smoothly, but it does not detect any source file. Does anybody have a clue?
I added -Dsonar.sources=.
to SONAR_SCANNER_OPTS
, to no avail.
I replaced `pwd`
with /c/Projects/my_project
, to no avail.
Thanks in advance.