Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
HTML
<div class="table-wrap"><table style="line-height: 1.4285715;" class="confluenceTable"><tbody><tr><td class="highlight-grey confluenceTd" data-highlight-colour="grey">By <a target="_top" href="http://www.sonarsource.com">SonarSource</a> &#8211; GNU LGPL 3 &#8211;
<a target="_top" href="http://jira.sonarsource.com/browse/SQSCANNER">Issue Tracker</a> &#8211;
<a target="_top" href="https://github.com/Sonarsource/sonar-scanner-cli">Sources</a>
<br>
<div>
    <div style="padding-top:10px;padding-bottom:5px">
    <span style="font-size:larger;"><strong>SonarQube Scanner 2.5.1<6</strong></span>
     &#8211; Compatible with SonarQube 4.5.4+ (LTS)
    <br>
    <a target="_top" href="https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-2.56.1.zip">Download</a>
    </div> 
</div> 
</div> </td></tr></tbody></table></div>

...

  1. Expand the downloaded file into the directory of your choice. We'll refer to it as <install_directory> in the next steps.
     
  2. Update the global settings (server URL) by editing <install_directory>/conf/sonar-runnerscanner.properties:

    Code Block
    languagebash
    #----- Default SonarQube server
    #sonar.host.url=http://localhost:9000
    
  3. Create a new SONAR_RUNNER_HOME environment variable set to <install_directory>.
     
  4. Add the <install_directory>/bin directory to your path.
     
  5. You can check the basic installation by opening a new shell and executing the command sonar-runner scanner -h (on Windows platform the command is sonar-runnerscanner.bat -h) . You should get a message like this:

    Code Block
    usage: sonar-runnerscanner [options]
     
    Options:
     -D,--define <arg>     Define property
     -e,--errors           Produce execution error messages
     -h,--help             Display help information
     -v,--version          Display version information
     -X,--debug            Produce execution debug output

...

Code Block
languagenone
sonar-runnerscanner

Include Page
SONAR:Include - Analysis - Security
SONAR:Include - Analysis - Security

...

Code Block
languagebash
# To run the computation of views (Views plugin is required)
sonar-runnerscanner views

# To run the computation of reports (Report plugin is required)
sonar-runner report

# To run the computation of developer data (Developer Cockpit plugin is required)
sonar-runner devcockpit

...

  • The properties can be specified directly through the command line. Ex:

    Code Block
    languagenone
    sonar-runnerscanner -Dsonar.projectKey=myproject -Dsonar.sources=src1

      

  • The property project.settings can be used to specify the path to the project configuration file (this option is incompatible with the project.home and sonar.projectBaseDir properties). Ex:

    Code Block
    languagenone
    sonar-runnerscanner -Dproject.settings=../myproject.properties

      

...

Note

If you get a Java heap space error or java.lang.OutOfMemoryError, you can increase the memory via the SONAR_RUNNERSCANNER_OPTS environment variable:

Code Block
languagenone
export SONAR_RUNNERSCANNER_OPTS="-Xmx512m -XX:MaxPermSize=128m"

On Windows environments, avoid the double-quotes, since they get misinterpreted and combine the two parameters into a single one.

Code Block
languagenone
set SONAR_RUNNERSCANNER_OPTS=-Xmx512m -XX:MaxPermSize=128m