I recently started using OSGi framework.. I am trying to launch an OSGi container from a maven based project..
I have added this dependency in my pom.xml file in the above maven project-
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
<version>4.2.1</version>
</dependency>
Below is my main application-
public static void main(String[] args) throws BundleException {
FrameworkFactory frameworkFactory = ServiceLoader.load( FrameworkFactory.class).iterator().next();
Map<String, String> config = new HashMap<String, String>();
//TODO: add some config properties
Framework framework = frameworkFactory.newFramework(config);
framework.start();
}
Now when I try to import the packages for the FrameworkFactory
, I get two options to choose from.. Below is the image. Can anyone help me out which one I need to choose here?
I was choosing these two?
import org.osgi.framework.launch.Framework;
import org.osgi.framework.launch.FrameworkFactory;
Is this right?