bnd

In bndtools, what causes a Require-Capability header for execution environment to be generated?

徘徊边缘 提交于 2020-12-30 06:52:29
问题 I have the following bnd file: Bundle-Version: 1.0.12 Bundle-Activator: a.b.Activator Private-Package: a.b -buildpath: osgi.core;version=4.3.0,\ org.apache.felix.bundlerepository;version=1.6.6,\ osgi.cmpn;version=4.3.0.201111022214 -sources: false In the generated MANIFEST.MF: Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.6))" I don't want this there... there's no reason I can see that it should be. So how do I avoid it? 回答1: bnd 2.3 automatically adds this. You can

In bndtools, what causes a Require-Capability header for execution environment to be generated?

帅比萌擦擦* 提交于 2020-12-30 06:52:15
问题 I have the following bnd file: Bundle-Version: 1.0.12 Bundle-Activator: a.b.Activator Private-Package: a.b -buildpath: osgi.core;version=4.3.0,\ org.apache.felix.bundlerepository;version=1.6.6,\ osgi.cmpn;version=4.3.0.201111022214 -sources: false In the generated MANIFEST.MF: Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.6))" I don't want this there... there's no reason I can see that it should be. So how do I avoid it? 回答1: bnd 2.3 automatically adds this. You can

How to include resource file into osgi bundle from jar dependency with bnd/maven-bundle-plugin?

◇◆丶佛笑我妖孽 提交于 2020-01-13 11:33:32
问题 I'm using maven-bundle-plugin ( bnd effectively). It's straightforward to include a resource file from sources. For example, a resource file ( src/main/resources/some.xml ) is moved under target directory ( target/classes/some.xml ) during build time and can be included into the bundle using <Include-Resource> instruction: <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>3.0.1</version> <extensions>true</extensions> <configuration>

How do you deserialize an object from bytes in osgi

放肆的年华 提交于 2020-01-11 04:45:09
问题 In my osgi application I have three bundles, travel.api , table.api and utils . travel.api depends on table.api which depends on utils . Note that travel.api doesn't directly depend on utils . I use aQute Bnd to generate the manifests and I believe it is working fine. The manifests are displayed below. There is a class called PageData that has a field of type TableData , which in turn has a field of type TestObject . PageData is located in travel.api , TableData is located in table.api and

How to override bnd Require-Capability generated from DS annotation?

半世苍凉 提交于 2019-12-24 05:49:26
问题 I have a bundle with an "optional" Component : It should be started if at leat one service of type X exist, and deactivated when the last service is unregistered. This component is "optional": It doesn't matter if X is registered or not, or if my component is activated or not. It's just an helper for managing instances of X. My component is declared like this : @Component public class MyManager { @Reference(cardinality=AT_LEAST_ONE) public void addService(X service) { .. } } However, bnd

How to copy a resource directory and all included files and sub-folders in a Jar onto another directory

丶灬走出姿态 提交于 2019-12-24 01:44:29
问题 Is it possible to copy a resource folder, and all the files within, including all directories and sub directories therein into another directory? What I've managed so far is to copy only one file resource, which is a CSS file: public void addCSS() { Bundle bundle = FrameworkUtil.getBundle(this.getClass()); Bundle[] bArray = bundle.getBundleContext().getBundles(); Bundle cssBundle = null; for (Bundle b : bArray) { if (b.getSymbolicName().equals("mainscreen")) { cssBundle = b; break; } }

BndTools, How to add a non-OSGi JAR?

隐身守侯 提交于 2019-12-24 00:59:22
问题 BndTools, How to add a non-OSGi JAR? I wanted to add jcraft Libraries into my osgi project. Using plain JAR breaks the whole project. Missing requirement wiring package ERROR: Bundle com.herle.iiot.application.installation [6] Error starting file:/D:/HERLE/Data/iot-sdk/FelixLauncher/bundle/com.herle.iiot.application.installation-1.5.0.jar (org.osgi.framework.BundleException: Unable to resolve com.herle.iiot.application.installation [6](R 6.0): missing requirement [com.herle.iiot.application

How to use org.apache.felix.scr annotations for a bundle from scratch?

耗尽温柔 提交于 2019-12-23 18:10:02
问题 I've started developing a bundle for apache felix and did so with the ops4j pax plugin. I've created the project structure with pax-create-project and in there did the normal pax-create-bundle . Then you get the initial project structure for building the whole thing with maven. The important part here is, that your bundle has it's own pom ( bundlename/pom.xml ) and bnd file ( bundlename/osgi.bnd ) but the configuration for maven-bundle-plugin is already provided under poms/compiled/pom.xml .

Embed thirdparty JAR using BND

南楼画角 提交于 2019-12-21 04:32:10
问题 I have an OSGi bundle that is built using ANT and the classic BND tool. My bundle uses a library (JAR) internally, which is not available as a bundle within my OSGi container (Apache Felix). So, I am trying to embed it within my bundle , for access at runtime. How can I embed such a library/JAR using ANT+BND? (Note : I cannot use MAVEN, using which this could have been a lot easier) 回答1: You need two instructions in your bnd descriptor. First use Include-Resource to include the target JAR

How to convert jar to OSGi bundle using eclipse and bndtools

天大地大妈咪最大 提交于 2019-12-17 15:51:51
问题 I am looking for a step by step guide to convert jar into an OSGi bundle using the eclipse bndtools plugin. I know it is possible to do it with bnd using the command line but would be nice to know how to do the same via the IDE. I might be missing something but this tutorial only explains how to create a project from scratch. 回答1: Follow the article Create Eclipse plugins (OSGi bundles) from standard jar to achieve this. Though this approach does not use Bnd, but you would be able to achieve