...
In this tutorial we will show you how to generate an ONOS bundle template. This makes it easy for you to add either an ONOS service or application. We will be using maven archetypes to generate our template, therefore this link could be handy if you would like to know more about this process.
Publish the artifacts to local repository
ONOS project started using BUCK from 1.7.0 hummingbird release. If you want to build ONOS application with maven archetype, you should publish the artifacts to local repository in ~/.m2:
Code Block | ||
---|---|---|
| ||
onos-buck-publish-local |
Generate your ONOS application project
Let's now generate an ONOS project which will be fully compilable and ready to be deployed. Although Although, you you will still have to code up your application, we haven't yet figured out how to generate code that does exactly what you would like it to do to do . So So let's start by running the following in a directory outside of $ONOS_ROOT:
Code Block | ||
---|---|---|
| ||
mvn archetype:generate -DarchetypeGroupId=org.onosproject -DarchetypeArtifactId=onos-bundle-archetype |
Notably, this command will download the newest RELEASE version of onos-archetypes plugin and generate an ONOS application.
Alternatively, if you have the ONOS code checked out and available, you can use the use the onos-create-app
tool to tool to accomplish the same thing. Run It's important to note that if your ONOS is a SNAPSHOT version and is built with Buck, you should change directory to $ONOS_ROOT/tools/package/archetypes and generate the onos-archetypes firstly:
Code Block | ||
---|---|---|
| ||
cd $ONOS_ROOT/tools/package/archetypes
mvn clean install |
Then run in a directory outside of $ONOS_ROOT:
...