I have a standalone application in which I've embedded Felix basically
following the process outlined here:
https://felix.apache.org/site/apache-felix-framework-launching-and-embedding.html
This application is a super or uber jar that embeds all of the necessary
bundles:
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${bundle.name}</Bundle-Name>
<Embed-Dependency>
org.restlet.lib.org.json,
*;artifactId=org.apache.felix.framework;inline=true,
*;artifactId=org.apache.felix.configadmin,
*;artifactId=org.apache.felix.ipojo,
*;groupId=org.apache.servicemix.bundles,
*;groupId=org.bouncycastle,
*;groupId=org.ops4j.pax.logging,
*;groupId=org.restlet.android,
*;groupId=${project.groupId};scope=runtime
</Embed-Dependency>
<Embed-Directory>bundle</Embed-Directory>
<Embed-Transitive>true</Embed-Transitive>
<Main-Class>${project.groupId}.${project.artifactId}.Main</Main-Class>
</instructions>
<obrRepository>NONE</obrRepository>
</configuration>
</plugin>
</plugins>
At runtime, it iterates over those embedded bundles and installs them via
org.osgi.framework.BundleContext.installBundle(String location). The
problem stems from the org.restlet.lib.org.json dependency. It is not a
bundle. So, trying to install it results in a BundleException. That makes
sense. The problem is I'm not sure how I'm supposed to inject it into my
embedded instance of Felix. See, if I deploy it to a regular standalone
instance of felix in it's ./bundle directory, everything appears to work
just fine. How do I replicate that behavior via the maven-bundle-plugin
and/or programmatically?
Thanks.