Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
titleNeeds update

This section needs to be updated for the latest version of ONOS, which is built using buck rather than maven

IDE Setup

The project does not enforce the use of a specific IDE, but rather, a set of guidelines that can be configured in an IDE. The examples and documentation focus on IntelliJ IDEA, and include some help for Eclipse. For other IDEs, developers should consult the documentation for the IDE of choice for specific configuration steps. 

...

A helpful screencast illustrating the entire import process can be found here (the link to the video is at the top of the page). Assuming you have obtained the source code already, the following steps can be followed to import ONOS into IntelliJ: 

  1. To import the ONOS project, simply open IntelliJ IDEA and select: File… New… Project from Existing Sources
  2. If you are starting IDEA for the very first time and don’t have any existing projects, you can alternatively select: Import Project… from the initial options.
  3. When presented with a file selection dialog, you should navigate to the top of the ONOS source tree and select the root pom.xml file. This will initiate the project import wizard.
  4. On the first screen we only need to check Sources and Documentation and then press Next.
  5. Select Next to bypass the Maven profiles.
  6. Make sure that the org.onosproject:onos Maven project is selected and press Next.
  7. After this select the JDK 8. If selecting JDK for the very first time, you may need to press the + sign to locate the JDK home directory. Press Next and then Finish.
  8. At this point IntelliJ will complete the import process by building the project and indexing the source files.

Importing the settings

While the project is being processed, we can go ahead and import the recommended IDEA settings. We do this by selecting File… Import Settings… and then navigating to the ONOStools/dev directory and selecting the idea-settings.jar file. We can complete the process by pressing the OK button.

...

If IntelliJ is throwing errors like "The package 'org.onosproject.cluster' is not exported by the bundle dependencies," go to IntelliJ IDEA->Preferences. On the sidebar, under the Editor dropdown section, select Inspections. From there, search OSGi and under the OSGi dropdown, uncheck Package accessibility inspections and press OK.

Importing the Copyright header

Since ONOS is licensed under Apache 2 license, we need to make sure that all source files are properly decorated with the Apache 2 license header file.

...