SDN Controller Programming Guide
115
The template sample application is ready to build and install. It serves as a good starting point to
new applications development.
To build the application simply change the working directory to the root module and use maven to
build the application as described above.
When Maven is finished, the application zip file can be found under the ~/sdn-hm/hm-
app/target directory. Use the SDN Controller GUI as described in Installing Application on page
116, to directly upload the application zip file and then ignite it.
Eclipse IDE project files can also be created automatically as described in Creating Eclipse
Projects.
Creating Eclipse Projects
Eclipse projects can be generated by executing the following Maven command from the
application root directory (~/dev/sdn-apps/health-monitor/hm-root for the sample application in
Linux):
$ mvn elipse:eclipse
Once the maven command completes, the projects can be imported from within the Eclipse IDE,
see Importing Java Projects on page 208.
Updating Project Dependencies
The command described in Creating Eclipse Projects above creates the Eclipse projects resolving
all dependencies desfined in the POM files. Once the projects have been created and imported
into Eclipse, the same command may be used to maintain dependencies.
Execute the command when a dependency is added to the POM file or removed, and then just
refresh the projects within Eclipse.
Building Application
In order to build the application, execute the following command from the application root
directory (~/dev/sdn-apps/health-monitor/hm-root for the sample application in Linux):
$ mvn clean install
Refer to Troubleshooting on page 216 in case of troubles building the application. When the
Maven’s build process is completed the application zip file (hm-*.zip) can be found under the
target directory of the application’s app module - /health-monitor/hm-app/target. Use the SDN
Controller GUI as described in Installing Application on page 116 to directly upload the
application zip file.In order to property compile source projects they must have at least one Java
class.
NOTE
If using the Sample Application Generator to create an application the application modules already
contain source files so skip the rest of the section, see Application Generator (Automatic Workspace
Creation) on page 114.