Versions Compared

Key

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

...

Go into XML and set to spaces and 120 width, 4 indentation

Character Configuration

Go to Preferences->General->Editors→Text Editors

Set tab width to "4"

Check "Insert spaces for tabs"

Go to Preferences->General→Workspace

Under "Text file encoding", select the "other" radio button, and choose "UTF-8" from the drop-down

Under "New text file line delimiter", select the "other" radio button and choose "Unix" from the drop-down

Removing White Space

Go to Preferences->java->Editor->Save Actions

...

Check "all Lines"

Click OK

Uncheck everything else in the other tabs

Click "Apply and Close"

Organize Imports Alphabetically

Go to Preferences->Java→Code Style→Organize Imports

Select all of the items and click "Remove"

Configuring Content Assist (so that Eclipse will provide suggestions for "import" statements)

Go to Preferences->Java->Editor→Content Assist→Favorites

Click "New type" and add "org.assertj.core.api.Assertions"

Click "New type" and add "org.mockito.Matchers"

Click "New type" and add "org.mockito.Mockito"

Disabling Validation (which slows local builds and generates numerous irrelevant warnings)

Go to Preferences→Validation

Uncheck "Allow projects to override these preference settings"

Deselect ALL

Setting up the ONAP Checkstyle in Eclipse

...

  1. Check out oparent
  2. git tag -l
  3. git co tags/1.2.1 -b 1.2.1
  4.  edit checkstyle/src/main/resources/onap-checkstyle/onap-java-style.xml, fix bugmodule name
    -            <property <module name="maxLineLength" value="120"/LineLength">
    +            <!--property            <module name="maxLineLength" value="120"/--LineLengthCheck">
  5. The versions in the POMs in oparent are snapshot, so we need to change those to 1.2.1
     mvn versions:set -DnewVersion=1.2.1
  6. Now build locally:
    mvn clean install

...

And then follow the steps mentioned here https://projectlombok.org/setup/eclipse

Enabling Sonar plugin

Install SonarLint via the Eclipse Market Place (Help→Eclipse Market Place)

Right click on one of the projects and select SonarLint→Bind to SonarQube or SonarCloud

Click the SonarQube radio button and then "Next"

Enter the URL, "https://sonar.onap.org"

Click the "Username + password" radio button and click "Next"

Enter your LF user name and password and click "Next"

Click "Next" and "Finish"

On the page, "Select projects to bind", click "Add"

Select all projects and click "Next"

In the "Select SonarQube/SonarCloud project" type "policy" and then pick the relevant policy repo from the drop-down list

Click "Finish"

Note: this process will take several minutes to run.  It may also generate the following warning in the console window, which can be ignored:

The following plugins do not meet the required minimum versions, please upgrade them on your SonarQube server