How to package OSGi subsystems with bndtools?

已查看 167 次
跳至第一个未读帖子

Eli Jordan

未读,
2015年9月19日 23:25:282015/9/19
收件人 bndtools-users
I am a noob to bnd, but have some experience with OSGi on the eclipse platform. I am doing some prototyping on IBM WAS Liberty profile, and found the tooling a little lacking, and so started seeing if bnd is an alternative. Liberty profile uses OSGi subsystems packed as a .esa for extensions to the runtime. It appears that it is possible to package a subsystem using BND (based on this https://github.com/bndtools/bnd/blob/master/biz.aQute.bndlib/src/aQute/bnd/exporter/subsystem/SubsystemExporter.java) but I can't find any documentation about how to setup an ESA project. Can someone give me some pointers?

BJ Hargrave

未读,
2015年9月21日 10:45:402015/9/21
收件人 bndtool...@googlegroups.com
On Sep 19, 2015, at 23:25 , Eli Jordan <elias.k...@gmail.com> wrote:

I am a noob to bnd, but have some experience with OSGi on the eclipse platform. I am doing some prototyping on IBM WAS Liberty profile, and found the tooling a little lacking, and so started seeing if bnd is an alternative. Liberty profile uses OSGi subsystems packed as a .esa for extensions to the runtime. It appears that it is possible to package a subsystem using BND (based on this https://github.com/bndtools/bnd/blob/master/biz.aQute.bndlib/src/aQute/bnd/exporter/subsystem/SubsystemExporter.java) but I can't find any documentation about how to setup an ESA project. Can someone give me some pointers?

The exporters are still a work in progress by Peter Kriens.


--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 

BJ



Marc Schlegel

未读,
2015年9月21日 10:45:492015/9/21
收件人 bndtools-users
No bnd-export myself, but I am also doing some Liberty-profile prototyping while using BndTools.

Since there is no IDE tooling available yet, I found the combination of the bnd-maven-plugin[1] together with the esa-maven-plugin[2] from Apache-Aries quite usefull. Furthermore you might have a look at the eba-maven-plugin[3] (also Aries) to deploy bundled osgi-appications on liberty.

If you are interested in tooling, I filed a feature-request at IBM [4], which asks that the IBM OSGI Tooling should be able to package BndTools projects.

Be aware: I had some trouble deploying a subsystem to liberty which was supposed to add a pax-cdi capability. Well, deployment worked, but the capability could not be resolved by application bundles. So I asked at the IBM site and it seems that features do not create a real subsystem (it is just a provisioning container). See answer to my post here [5], though I have to say that I havent investigated this issue any further and hope that cdi will be available in a coming liberty-release (disclamer: I only need cdi because it is used in some third-party library I am using).


Hope that gets you started

regards
Marc

David Jencks

未读,
2015年9月21日 14:58:572015/9/21
收件人 bndtool...@googlegroups.com
Could you clarify exactly what you are trying to deploy to liberty?  There are “Liberty Features”  which have a manifest that looks sort of like an OSGI feature subsystem but aren’t, and there are OSGI feature subsystems.  My understanding (don’t quote me) is that the OSGI subsystem support generally works but is not “officially supported”.  The OSGI subsystem support is based on Apache Aries, the “Liberty Feature” support is decidedly not.

My impression is that you have been working with OSGI feature subsystems and Erin’s answer applies to Liberty Features.  Lets see if we can clarify what you are trying to do first :-)

thanks
david jencks

Marc Schlegel

未读,
2015年9月21日 16:23:492015/9/21
收件人 bndtools-users
In order not to hijack this thread I am going to create a new one, since the two issues are only losely related. Short answer: yes, I expected the liberty-features to be a subsystem (because the manifest is basically the same with some additional IBM headers).

I think the answer regarding the original question is correct. The bnd-maven-plugin togeher with the esa-maven-plugin can create a deployment for liberty

Eli Jordan

未读,
2015年9月21日 19:04:092015/9/21
收件人 bndtools-users
I am interested in Liberty features. I thought that they were in fact osgi subsystems. The manifest at least looks the same as a regular subsystem manifest, with some additional IBM headers. I was hoping I would be able to use the features of the .bnd file to generate this manifest. Is this possible with the maven-esa-plugin? Or would I have to write the file manually?

Marc Schlegel

未读,
2015年9月22日 03:40:572015/9/22
收件人 bndtools-users
Since liberty-features have their own special folder structure I ended up creating everything by hand, which isnt so much work. With the esa-maven-plugin you can provide your own manifest (including the IBM headers) to be packaged but as we just figured out this wont be recognized as a liberty-feature.

In fact, in my first attempt I expected that a esa-file dropped to liberties deploy-folder would install this as a feature. Instead, this seems to deploy a osgi-subsystem but I have to check this first.

To sum up: 
  • If you need a liberty-feature (not a osgi-feature-subsystem) the esa-maven-plugin wont work for deployment
  • Manually create feature-folder structure and put it under <liberty-root>/usr/extension/lib [1]
I do not know what kind of liberty-feature you want to create, but I was able to provide full Struts-1 support as a feature for JEE applications to use. It packages all the old dependecies using bnd, while only exporting the packages necessary for struts-development. I documented everything as an answer to my question on developerworks [2]

[1] Step 4 at https://www-01.ibm.com/support/knowledgecenter/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/twlp_feat_example.html
[2] https://developer.ibm.com/answers/answers/175125/view.html

Eli Jordan

未读,
2015年9月22日 06:27:562015/9/22
收件人 bndtools-users
That's quite a detailed answer! I'll have a look through it. The feature I'm adding is the eclipse extension registry, because we use it extensively in our code base, and it's not supported out of the box
回复全部
回复作者
转发
0 个新帖子