onos-app-samples and app.xml

85 views
Skip to first unread message

Rusty Eddy

unread,
Apr 26, 2015, 2:25:21 PM4/26/15
to onos...@onosproject.org
All,

I have a new app onos-app-samples/mfwd build and can be deployed fine.

All of the current apps in the sample repository have app.xml created and saved in the target/oar directory during the build process.

If I build mfwd with the mfwd/app.xml in the root directory the .oar file is created, if I remove the app.xml (like the other apps in the samples directory) the .oar file is not created.   I build is successful, the .jar files are created, just no .oar.

Defining app.xml in the root directory everything seems fine, however I feel like I am missing something that is probably important?

Thanks,



t: @rustyeddy

Thomas Vachuska

unread,
Apr 26, 2015, 3:27:05 PM4/26/15
to Rusty Eddy, onos...@onosproject.org
Hi Rusty,

If your app is a simple, single-bundle app, you can safely remove the app.xml file and instead define onos.app.name property in the pom.xml file to give your application a name and to trigger the automatic assembly of the .oar file using a boiler-plate app.xml and features.xml patterns. Look into fwd/pom.xml file on how to define the property.

Thomas

--
You received this message because you are subscribed to the Google Groups "ONOS Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to onos-dev+u...@onosproject.org.
To post to this group, send email to onos...@onosproject.org.
Visit this group at http://groups.google.com/a/onosproject.org/group/onos-dev/.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/onos-dev/CACt_Cc3BQxYCLuvELj%2B4Ch3fBQNU5Cncih2wry0%3D8W9HMJsDrw%40mail.gmail.com.

Brian O'Connor

unread,
Apr 26, 2015, 3:27:36 PM4/26/15
to Rusty Eddy, onos...@onosproject.org
Hi Rusty,

In the onos-maven-plugin, there is a check for precisely the behavior that you are seeing:
// If neither the app.xml file exists, nor the onos.app.name property
// is defined, there is nothing for this Mojo to do, so bail.
if (!appFile.exists() && name == null) {
return;
}
In order to have maven automatically generate the .oar file, all you need to do is put an app.xml file in the app's "root" directory i.e. at the same level as the app's pom.xml.

- Brian

Brian O'Connor

unread,
Apr 26, 2015, 3:30:13 PM4/26/15
to Rusty Eddy, onos...@onosproject.org
P.S. Or, as Thomas pointed out, "name" in the above code snippet is the "onos.app.name" property from the pom.xml, so either define an app.xml or include "onos.app.name". 

Rusty Eddy

unread,
Apr 26, 2015, 3:49:30 PM4/26/15
to Thomas Vachuska, Brian O'Connor, onos...@onosproject.org
OK, Got it.

Thanks once again for the quick and useful help Thomas & Brian.!


t: @rustyeddy


Reply all
Reply to author
Forward
0 new messages