Setting up Apache Felix for Snippets
Installing Apache Felix
Apache Felix has a binary distribution that you should download and install. Starting the framework in Felix brings up a shell that allows you to use OBR directly from the command line. All examples assume that you have the fileinstall bundles running. This program is available from the OSGi OBR.
- Enter the following from the command line:
-> obr add-url http://www2.osgi.org/repository/repository.xml-> obr deploy aQute.fileinstall-> obr start aQute.fileinstallTarget resource(s):-------------------aQute.fileinstall (1.0.0)Deploying...done.
This will install and start the FileInstall utility. Starting this creates a "load" folder. Any bundle in this folder will be installed and started. - download Download the bnd utility. This is a jar file that can be started with java -jar bnd.jar. It is advisable to create a small shell script for your environment so you can run it easily from the command line.
The remainder assumes that > bnd starts the bnd utility.
Creating a Bundle
The bnd utility will create a bundle from a bnd file. Create a file with a bundle symbolic name with the .bnd extension. If you use Eclipse for compiling your code then bnd will pickup the .classpath file if it is in the same directory as the bnd file. In other environments it might be necessary to set the classpath with -classpath in the bnd file.
The following command will create a bundle out of it:
> bnd bsn.bnd



