Configuration and usage specific to Eclipse SonarQube plugin will be described here.

Pre-requisites 

Install Sonar Eclipse plugin according to the version of your Eclipse IDE

http://docs.codehaus.org/display/SONAR/Installing+SonarQube+in+Eclipse

Remote analysis

Configure Sonar Eclipse plugin as mentioned here, note the following specific configurations need to be done

      Setting SonarQube server URL

           URL  https://analysis.apache.org

           Username / password : leave blank

      Advanced Configuration

           Window > Preferences > SonarQube,

                 In “JVM arguments for preview analysis” field, set the following

      -Dsonar.scm-stats.enabled=false



Now you can associate any project with Sonar and perform analysis

Results will be displayed in “SonarQube Issues” tab in Eclipse.

 

Double click on an issue, it will take you to the exact line number. 

For more information on this please refer this link

Local analysis

Refer this for setting up local SonarQube server in your machine. Then you can run a local analysis as below instructed,

  •    Right click on the project in Eclipse, and then Configure > Associate with SonarQube
  •    In the SonarQube project text field, start typing the name of the project and select it in the list box
  •    Refer Sonar docs for more information 
  • No labels