Search code examples
linuxjenkinssonarqubejenkins-pluginssonar-runner

Jenkins and Sonar - How to use Sonar Runner with Linux (Because it only has a .bat executer)


I have a distant linux system with a Tomcat containing Jenkins and the Sonar server (v 3.7.4). I am also using the Sonar Runner (v 2.1), but can I really use it in a linux environnement ? I mean, the bin repository only contains a .bat file, no .sh.

So if in Jenkins I set the SONAR_RUNNER_HOME to the path of my sonar runner install repository on linux, is it gonna work ? Because obviously if I want to run the .bat file myself to do test it (after the creation of sonar-project.properties file), well, I can't.

I didn't find anything about that on Google, as if there was no problem about it.


Solution

  • You can use sonar-runner which is shell script (it's marked as a Unix executable).

    However, please note that Sonar 3.7.4 is really old (more than 3 years old). So I highly suggest to upgrade to latest LTS (5.6.6) and you will benefit also of the Jenkins plugin (https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins)