Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Set up SonarLint towards ONAP for IntelliJ

PreRequisites

To use SonarLint with Onap projects you need to setup a connection with SonarCloudTo bind your projects to the ONAP Sonar server, follow the instructions below.

  1. Select, File, Settings, Tools, SonarLint....  Right click
  2. Click on the project and select "SonarLint -> Bind to SonarQube or SonarCloud...".+ beside the 'SonarCube / SonarClod connections' box to add a new connection
  3. Set Configuration Name to something like 'ONAP'
  4. Ensure sonarcloud is selected  and click [Next]
  5. Click [Create Token]
  6. Select GitHub, logon and follow the GitHub wizard to create a Token
  7. Copy Token into IntelliJ wizard
  8. Click [Next] (might have to wait a little while your data is being downloaded)
  9. Select 'Open Network Automation Platform (ONAP)' from 'Your Organizations' and click [Next]
  10. Click [Finish] to close the wizard
  11. Click [OK] to leave settings

Then you need to bind each project to the corresponding project in GitHub/SonarCloud:

  1. Select, File, Settings, Tools, SonarLint, Project Settings
  2. Enable (check) 'Binfd project to SonarQube / SonarCloud'
  3. Select the connection created above using the [Configure the connection] button
  4. Enter the project name (e.g. 'onap_ccsdk-sli-plugins') or select it using [Search in list..] 
  5. Select "sonarcloud" and press "Next".
  6. Click "Generate Token"
  7. A browser opens and you are taken to a Sonarcloud login page
  8. Login with an appropriate account from the list presented, most likely your GitHub account
  9. You are now directed to a sonarcloud token generation page
  10. Enter a name for your token and click "Generate"
  11. Copy the token hex string that is generated from the browser and paste it into the "Token" field in Eclipse and click "Next"
  12. In the "Organization" field, enter the string "onap" and press "Next"
  13. The Connection name "SonarCloud/onap" should be found by the system, click "Next"
  14. The connection should be successfully created, click "Finish"
  15. Press "Add...".
  16. Select the projects you want to add and press "OK".
  17. Press "Next".
  18. Start typing the name of your project, and it should appear in a list box where it should be selected.Press "Finish".
  19. Click [OK] to finish

Other Tools

The component you are working on may require additional tool installations, see the relevant section under Development Guides.

...