Network Deployment (Distributed operating systems), v8.0 > Develop and deploying applications > Develop OSGi applications > Develop and deploying an OSGi application > Create an OSGi application


Create an OSGi application using Apache Ant

We can use the Apache Ant (Ant) command-line tool to package bundles together into an OSGi application.


Before you begin

This topic assumes that you understand how to use the Ant build tooling, and that we have already created the bundles and the application manifest file to package together as an OSGi application.

For a detailed overview of creating an OSGi application, and instructions on how to do this using IBM Rational Application Developer Version 8 or similar tooling, see Create an OSGi application.


About this task

The code example in this topic shows the syntax for using the Ant zip task to package a set of bundles and an application manifest (APPLICATION.MF) file into an enterprise bundle archive (.eba) file.


Example

<zip destfile="${output.dir}/myExample.eba" basedir="${basedir}">
<filename name="META-INF/APPLICATION.MF"/>
<fileset dir="${basedir}">  
<include name="*.jar"/>
</fileset>
</zip> 

This example packages the META-INF/APPLICATION.MFfile into the EBA file, and also includes all files ending in ".jar" (that is, the bundles).

${output.dir} and ${basedir} refer to the following Ant properties:


What to do next

We can use the administrative console or wsadmin commands to deploy and start an OSGi application in WAS. See Deploy an OSGi application as a business-level application and Start your business-level application.

Parent topic: Create an OSGi application

Related concepts:

About OSGi Applications

Related tasks:

Secure OSGi Applications

Related reference:

The Apache Ant project
OSGi Applications: Troubleshooting tips
Task topic Feedback
Copyright IBM Corporation 2009, 2011. All Rights Reserved.
This information center is powered by Eclipse technology.

+

Search Tips   |   Advanced Search