Prerequisites
Before building the ONOS Sample Apps, you should make sure that you have installed Java, git, and Maven.
Maven vs. Buck
Beware: ONOS and ONOS core applications are currently built using buck
, but the sample apps are currently built using Maven. 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.
Fetching the Source Code
git clone https://gerrit.onosproject.org/onos-app-samples cd onos-app-samples
Selecting the ONOS Version
By default, the sample apps will be built against a nightly snapshot of ONOS master. The functionality and reliability of this snapshot may vary rapidly and unpredictably, but it may also be what you want if an application requires bleeding-edge features.
If you wish to build against a released version of ONOS rather than a random snapshot, you can edit pom.xml to specify a specific ONOS release. For example:
<parent> <groupId>org.onosproject</groupId> <artifactId>onos</artifactId> <version>1.8.2</version> </parent>
Basic Compilation
To simply compile and check for errors, you can run
mvn compile
This will download all of the required .jar
files, including ONOS as well as other required libraries, and compile the Java source into .class
files.
Building the .oar files
To build the .oar files, you can run
mvn install