felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Madhavan <mattmadha...@gmail.com>
Subject Re: Maven Felix Bundle plugin (BND) - How to tell BND to ignore the jars inside of WEB-INF/lib
Date Tue, 23 Aug 2011 17:29:33 GMT
Hello Peter,
Couple of things! I agree with you and let the BND do its thing. Also not
sure why IBM guys had so many jars in the bundle classpath. I can see may be
something like a struts.jat and sitelib.jar being there and not commons!

Also looks like the dependency to orag.apache.log and other Avalon
dependencies come from PAX Logging bundles. Not sure why they would need to
be referencing to these? In any case they are marked optional.

The app works fine when deployed to Felix using mvn pax:provision. When I
deploy to WAS it says my web bundle has a required dependency to
org.apache.log and fails. Its actually a transient dependecy. Unfortunately
the IBM OSGi Console is not really a good tool! Like equinox or Felix
console I cannot trace the missing transient dependency at all. If the EAB
fails to load it shows nothing - zip!

Actually the bank application I took from IBM was from the IBM RedBook on
OSGi/JPA. The app was already in OSGi and I converted it to use PAX and
Felix Bundle Plugin, ITests etc. I'm now trying to convert this app to be
RAD friendly and now I'm running into all kinds of issue with RAD/WAS.

If you are interested in this app, I will have to change the Package names.
I currently has the package name of my client's reverse domain name. I'm not
sure if I can give it out like that. I will change it and publish it when
its ready.


On Tue, Aug 23, 2011 at 3:08 AM, Peter Kriens <peter.kriens@aqute.biz>wrote:

> Well, you should let bnd do its work, these dependencies are really there
> and potentially reachable from the code. It is just a sign how messy the
> current development is that we like to ignore they exist ...
> However, you want to get rid of the warnings. What you can do in the maven
> plugin is ignore certain imports with the bang (exclamation mark).
>        Import-Package: !org.apache.log, *
> Or better, make them optional:
>        Import-Package: org.apache.log;resolution:=optional,*
> You can use wildcards with the bang as well as the optional. I know it
> sounds like busy work but I think it is crucial to realize that you got
> these trojans and space wasters in your WAR file.
> Don't forget the * at the end.
> Could you send me your project after you've done this? I know some people
> here in IBM Montpellier that were thinking of taking the bank app and port
> it to OSGi. I understood they are the authors of this app.
> Kind regards,
>        Peter Kriens
> > Hello Peter,
> > As posted in an earlier post (actually a reply to your reply) I have a
> > stringent requirement from my client that everything I do as far as OSGi
> > development process, must run seamlessly with in IBM RAD and WAS env. But
> my
> > OSGi development process is mainly of BND and PAX based!
> >
> > So as a POC I took an example from IBM RedBook called the bank
> application,
> > and converted (created a new project from scratch) using PAX and BND.
>  Now
> > I'm trying to convert the project so that RAD will recognize if as OSGi
> > project etc. After a lot of frustrating hrs and days I'm close to make it
> > work in RAD env.
> >
> > Only problem is the example has bunch of JARS inside the WEB-INF/lib
> folder.
> > The same jars deploy just fine when deployed as part of the original IBM
> > Bank app.
> >
> > But when I build a bundle (including generating the META-INF/MANIFEST-MF)
> > the BND tools introspects the WEB-INF/lib jars also! This results in some
> > missing transient dependencies to old Apace Avalon org.apache.log
> packages.
> > I have no idea how this happens! Not sure which bundle is referring to
> this
> > package at all!
> >
> > Question is how do I tell Apache Maven Plugin to ignore the jars in
> > WEB-INF/lib folder while generating the META-INF/MANIFEST.MF file? One
> > option will be to hard code the META-INF/MANIFEST.MF,  but I really do
> not
> > want to do that! Any ideas please?
> >
> > Thanks in advance!
> >
> > Matt

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message