Versions Compared

Key

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

...

  1. Select "Window -> Preferences".
  2. In the filter text box, type "tab".
  3. Under "Editors -> Text Editors", set "Displayed tab width:" to 4.
  4. Under "Editors -> Text Editors", activate "Insert spaces for tabs".
  5. 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.
  6. Under "XML -> XML Files -> Editor", change to "Indent using spaces".
  7. Clear the filter text box and type"format".
  8. Under "Java → Code Style Formatter", for "Active profile:" select GoogleStyle.
  9. Press the "Edit..." button.
  10. Expand the "Indentation" section.
  11. Select "Spaces only" for "Tab policy", and "4" for "Indentation size".
  12. Expand the "Line Wrapping" section.
  13. Set "Maximum line width:" to "120", and press "OK".
  14. Clear the filter text box and type "save actions".
  15. Under "Java -> Editor -> Save Actions", check the "Perform the selected actions on save", and "Additional actions" check boxes.
  16. Press the "Configure..." button.
  17. On the "Code Organizing" tab in the "Formatter" box, check the "Remove trailing whitespace" check box.
  18. Press "OK".
  19. Under "Maven -> User Settings", press the "Browse" button beside the "User Settings" text box.
  20. Browse to the Maven repository location, select the xml file for ONAP, and press "Open".
  21. Select "Java -> Editor -> Content Assist -> Favorites".
  22. 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
  23. Select "Java -Code Style -> Organize Imports".
  24. Move the "com" item in the list to the top position, using the "Up" button on the right.
  25. 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.

  1. Right click on the project and select "SonarLint → Bind to SonarQube or SonarCloud...".
  2. Select "sonarqube" and press "Next".
  3. Paste "https://sonar.onap.org/" in to the "URL:" text box and press "Next".
  4. Select the "Username + Password" option and press "Next".
  5. Provide your LinuxFoundation user name and password and press "Next".
  6. Accept the suggested name or type your own and press "Next".
  7. Press "Finish".
  8. Press "Add...".
  9. Select the projects you want to add and press "OK".
  10. Press "Next".
  11. Start typing the name of your project, and it should appear in a list box where it should be selected.
  12. 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 

...