...
Set up SonarLint towards ONAP for IntelliJ
PreRequisites
- You need to be part of the onap organization in GitHub
- (see GitHub, click on your icon and select 'My Organizations')
If you are not a member of this organization email support.linuxfoundation.org and ask to be added to the onap organization in GitHub
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.
- Select, File, Settings, Tools, SonarLint.... Right click
- Click on the project and select "SonarLint -> Bind to SonarQube or SonarCloud...".+ beside the 'SonarCube / SonarClod connections' box to add a new connection
- Set Configuration Name to something like 'ONAP'
- Ensure sonarcloud is selected and click [Next]
- Click [Create Token]
- Select GitHub, logon and follow the GitHub wizard to create a Token
- Copy Token into IntelliJ wizard
- Click [Next] (might have to wait a little while your data is being downloaded)
- Select 'Open Network Automation Platform (ONAP)' from 'Your Organizations' and click [Next]
- Click [Finish] to close the wizard
- Click [OK] to leave settings
Then you need to bind each project to the corresponding project in GitHub/SonarCloud:
- Select, File, Settings, Tools, SonarLint, Project Settings
- Enable (check) 'Binfd project to SonarQube / SonarCloud'
- Select the connection created above using the [Configure the connection] button
- Enter the project name (e.g. 'onap_ccsdk-sli-plugins') or select it using [Search in list..]
- Select "sonarcloud" and press "Next".
- Click "Generate Token"
- A browser opens and you are taken to a Sonarcloud login page
- Login with an appropriate account from the list presented, most likely your GitHub account
- You are now directed to a sonarcloud token generation page
- Enter a name for your token and click "Generate"
- Copy the token hex string that is generated from the browser and paste it into the "Token" field in Eclipse and click "Next"
- In the "Organization" field, enter the string "onap" and press "Next"
- The Connection name "SonarCloud/onap" should be found by the system, click "Next"
- The connection should be successfully created, click "Finish"
- Press "Add...".
- Select the projects you want to add and press "OK".
- Press "Next".
- Start typing the name of your project, and it should appear in a list box where it should be selected.Press "Finish".
- Click [OK] to finish
Other Tools
The component you are working on may require additional tool installations, see the relevant section under Development Guides.
...