I\'d like to be able to easily start an OSGi framework (preferably Equinox) and load up any bundles listed in my pom from a java main.
Is this possible? If so, how?
Edit: Realized you wanted to start from inside java. Shame on me for not reading close enough
Check out this link. http://www.eclipsezone.com/eclipse/forums/t93976.rhtml
Essentially
public static void main(String args[]) throws Exception {
String[] equinoxArgs = {"-console","1234","-noExit"};
BundleContext context = EclipseStarter.startup(equinoxArgs,null);
Bundle bundle = context.installBundle(
"http://www.eclipsezone.com/files/jsig/bundles/HelloWorld.jar");
bundle.start();
}
Edit: Maven
It seems that https://groups.google.com/group/spring-osgi/web/maven-url-handler?pli=1 contains an OSGi URl Handlers Service that can take URLS of the following format and load bundles from them ( mvn://repo/bundle_path )