Deploy a bundle to Apache Felix via Ant?
Let's suppose I have a valid Ant build script which packs up and prepares my OSGi bundle.
Now, I would like to make the build process install/update the bundle to my local Felix installation as the last step, and - if possible, automatically start if not started by default.
Anyone has an idea how to do this?
I was thinking about making a simple Ant plugin to wrap up a system co开发者_StackOverflow中文版nsole commands sent to some shell, but is there some more nice way to do this?
You might have a look at the Apache Felix File Install. To quote from the intro:
File Install is a directory based OSGi management agent. It uses a directory in the file system to install and start a bundle when it is first placed there. It updates the bundle when you update the bundle file in the directory and, when the file is deleted, it will stop and uninstall the bundle.
So, all you need to do is to write a task that copies your bundle to the install directory.
have a look at Pax Runner (1). There are command line and Maven plug-in for it. You can write Ant plug-in for command line API.
Regards, Dmytro
(1): http://paxrunner.ops4j.org/space/Pax+Runner
精彩评论