0

I'm trying to check the code quality of my project using Sonarqube.

I have created a Docker container which has both Sonarqube and my project. I've added the Sonarqube bin file to my path: /root/sonarqube-6.2/bin/linux-x86-64/.

I have started the Sonarqube script with: sonar.sh start.

Then, in my project's main directory I added a file sonar-project.properties with this content:

# must be unique in a given SonarQube instance
sonar.projectKey=my:project
# this is the name displayed in the SonarQube UI
sonar.projectName=My project
sonar.projectVersion=1.0

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# Since SonarQube 4.2, this property is optional if sonar.modules is set. 
# If not set, SonarQube starts looking for source code from the directory containing 
# the sonar-project.properties file.
sonar.sources=.

# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8

Then, from the main directory of the project I am running this: sonar-runner.

However, the command is not recognised:

bash: sonar-runner: command not found

What am I doing wrong?

bsky
  • 19,326
  • 49
  • 155
  • 270
  • Normally you scan your project on a different location than where SonarQube installed. Look also at [this](http://stackoverflow.com/questions/39850646/sonarqube-runner-vs-scanner) post explaining the difference between "runner" and "scanner" and [this](https://docs.sonarqube.org/display/SCAN/Analyzing+Source+Code) scanner documentation page. – Jeroen Heier Jan 31 '17 at 05:24
  • So from what I understand `scanner` is the same as `runner` but for old SonarQube versions. That shouldn't affect me, since I'm not using an old version. – bsky Jan 31 '17 at 11:12
  • 1
    You have it backwards @octavian. 'runner' is the old version; 'scanner' is the new. – G. Ann - SonarSource Team Jan 31 '17 at 12:40

0 Answers0