Articles → SONARQUBE → Integrate Sonarlint And Eclipse

Integrate Sonarlint And Eclipse






Sonarlint





How To Install Sonarlite?




  1. Go to help → ‘Eclipse Marketplace..’.
  2. Eclipse Marketplace window will appear. In the find textbox search for sonarlint.
  3. Picture showing the Eclipse Marketplace window
    Click to Enlarge

  4. Click on ‘Install’ button to install sonarlint.

Configure Sonarlint In Eclipse




  1. Go to Window → Show View → Other..
  2. Picture showing the other option in the show view menu
    Click to Enlarge

  3. A pop up window will appear, click on SonarLint → SonarLint Bindings and click ‘Open’.
  4. Picture showing the SonarLint Bindings inside the show view window
    Click to Enlarge

  5. Once you click on ‘Open’, Sonarlint binding window will appear
  6. Picture showing the Sonarlint binding window
    Click to Enlarge

  7. Click on ‘Connect to a SonarQube server…’. Following window will appear
  8. Picture showing the first screen of the Connect to a SonarQube server… to select the connection type
    Click to Enlarge

  9. Select Sonarqube and click on ‘Next >’.
  10. In the next window, enter the server URL and click on ‘Next >’.
  11. Picture showing the screen of the Connect to a SonarQube server… to specify the server URL
    Click to Enlarge

  12. Next step is to choose the authentication method. Click ‘Next >’.
  13. Picture showing the screen of the Connect to a SonarQube server… to specify the authentication method
    Click to Enlarge

  14. Next window ask you to set user name and password. Enter the credentials and click ‘Next >’.
  15. Picture showing the screen of the Connect to a SonarQube server… to specify the username and password
    Click to Enlarge

  16. In the next step, the connection will be checked. If the connection is valid then a window will appear to set the connection name. Enter the connection name and click on ‘Next >’.
  17. Picture showing the screen of the Connect to a SonarQube server… to specify the connection identifier
    Click to Enlarge

  18. Connection gets completed.
  19. Picture showing the screen of the Connect to a SonarQube server… to specify that configuration is completed
    Click to Enlarge

  20. Click on ‘Finish’.

Bind Project




  1. Right-click on binding and click on ‘Bind Projects…’.
  2. Picture showing the Bind Projects menu in eclipse
    Click to Enlarge

  3. Following window will appear.
  4. Picture showing a window to select the project for sonarqube binding
    Click to Enlarge

  5. You can click on ‘Add…’ and a window will appear to select the project
  6. Picture showing the window to select the project to bind
    Click to Enlarge

  7. Select the project and click on Ok. Project gets selected in the parent window. Click on ‘Next >’ to proceed.
  8. Picture showing the window to select the project to bind
    Click to Enlarge

  9. In the next window, you can select the sonarqube project. You can either select the new name or the existing name
  10. Picture showing specifying the binding name
    Click to Enlarge

  11. Click on ‘Finish’.

How To Check Issues On Eclipse




  1. Go to Window → Show View → Console
  2. Picture showing the menu option to open sonar console
    Click to Enlarge

  3. Click on ‘Display Selected Console’ and select ‘Sonarlint Console’
  4. Picture showing the option to open sonarlint console
    Click to Enlarge

  5. Now change some coding and press CTRL + S


  6. Picture showing the issues in sonar console
    Click to Enlarge



    Picture showing the curly lines below the code when there is an issue in the code
    Click to Enlarge



Posted By  -  Karan Gupta
 
Posted On  -  Friday, November 29, 2019

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250