...
- Select "Window -> Preferences".
- In the filter text box, type "tab".
- Under "Editors -> Text Editors", set "Displayed tab width:" to 4.
- Under "Editors -> Text Editors", activate "Insert spaces for tabs".
- If you want a visual aid for the print margin, under "Editors -> Text Editors", activate "Show print margin" and set "Print margin column:" to 120.
- Under "XML -> XML Files -> Editor", change to "Indent using spaces".
- Clear the filter text box and type"format".
- Under "Java → Code Style Formatter", for "Active profile:" select GoogleStyle.
- Press the "Edit..." button.
- Expand the "Indentation" section.
- Select "Spaces only" for "Tab policy", and "4" for "Indentation size".
- Expand the "Line Wrapping" section.
- Set "Maximum line width:" to "120", and press "OK".
- Clear the filter text box and type "save actions".
- Under "Java -> Editor -> Save Actions", check the "Perform the selected actions on save", and "Additional actions" check boxes.
- Press the "Configure..." button.
- On the "Code Organizing" tab in the "Formatter" box, check the "Remove trailing whitespace" check box.
- Press "OK".
- Under "Maven -> User Settings", press the "Browse" button beside the "User Settings" text box.
- Browse to the Maven repository location, select the xml file for ONAP, and press "Open".
- Select "Java -> Editor -> Content Assist -> Favorites".
- For each of the types below, press "New Type..." and type in the type and press "OK".
org.junit.Assert
org.junit.Assume
org.junit.jupiter.api.Assert
org.junit.jupiter.api.Assume
org.mockito.Mock
org.mockito.Mockito - Select "Java -Code Style -> Organize Imports".
- Move the "com" item in the list to the top position, using the "Up" button on the right.
- Press "Apply and Close".
Install useful plugins
Install EclEmma: https://www.eclemma.org/installation.html, and SonarLint: https://www.sonarlint.org/eclipse/.
To bind your projects to the ONAP Sonar server, follow the instructions below. Your projects should beimported in to Eclipse before this.
- Right click on the project and select "SonarLint → Bind to SonarQube or SonarCloud...".
- Select "sonarqube" and press "Next".
- Paste "https://sonar.onap.org/" in to the "URL:" text box and press "Next".
- Select the "Username + Password" option and press "Next".
- Provide your LinuxFoundation user name and password and press "Next".
- Accept the suggested name or type your own and press "Next".
- Press "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".
To see messages from Sonar introduced by edits made in the projects, select "Window → Show Wiew → Other...". Expand "SonarLint" and select "SonarLint → On-The_fly".
IDE: IntelliJ
Installing Intellij Community Edition on Linux
...