Versions Compared

Key

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

In addition to the core ONOS system and applications, the ONOS project has created sample applications ("ONOS Sample Apps") which provide additional features and can also serve as instructional code or as something that you can extend and modify into a full-featured application. 

Prerequisites

Before building the ONOS Sample Apps, you should make sure that you have installed Java, git, and Maven.

Info
titleMaven vs. Buck

Beware: ONOS and ONOS the core applications in the main ONOS source tree are currently built using buck, but the sample apps in onos-app-samples are currently built using mvn. This may change in the future! It is likely that we will move to a single build system for both ONOS and all of its applications.

...

To simply compile and check for errors, you can cd to the onos-app-samples directory and run:

Code Block
languagebash
mvn compile

...

It will produce a lot of output, but should eventually succeed, printing something like:

Code Block
languagebash
[INFO] Reactor Summary:
[INFO] 
[INFO] onos-app-samples ................................... SUCCESS [  2.619 s]
[INFO] onos-app-calendar .................................. SUCCESS [  1.290 s]
[INFO] onos-app-database-perf ............................. SUCCESS [  0.272 s]
[INFO] onos-app-flowtest .................................. SUCCESS [  0.359 s]
[INFO] onos-app-ifwd ...................................... SUCCESS [  0.247 s]
...
[INFO] onos-app-icona ..................................... SUCCESS [  0.051 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.487 s
[INFO] Finished at: 2017-02-03T15:32:55-08:00
[INFO] Final Memory: 76M/379M
[INFO] ------------------------------------------------------------------------

Building the .oar files

To compile each app all the way from Java into an .oar (ONOS app archive) file which can be installed into ONOS, you can run

Code Block
languagebash
mvn install

 in the onos-apps-samples directory.

This will produce similar output to that produced by mvn compile, but will take slightly longer since it is creating the .oar files as well.

...

The .oar files are suitable for installation into the appropriate version of ONOS that you specified in pom.xml.

Note that mvn install doesn't actually install the package into ONOS! Rather you need to follow the appropriate instructions for installing and activating the app into your own ONOS system.

Application installation and activation is discussed in Managing ONOS applications.

...