RE: managing OSGi Dependencies

2014-10-24 Thread Neil Bartlett
Inline responses… From: Paulo Renato de Athaydes Reply: users@felix.apache.org > Date: 25 October 2014 at 00:37:50 To: users@felix.apache.org > Subject:  RE: managing OSGi Dependencies > Or perhaps they were necessary to satisfy the javac compiler but they  were not necessary or even sufficie

RE: managing OSGi Dependencies

2014-10-24 Thread Paulo Renato de Athaydes
> Or perhaps they were necessary to satisfy the javac compiler but they were not necessary or even sufficient to actually run the code. Not necessary: true because you may specify more than needed if you're not careful. Not sufficient? Wrong. That's what compilers are for. You need to have all

RE: managing OSGi Dependencies

2014-10-24 Thread Neil Bartlett
No, I’m not. Bnd performs a full inspection of the dependencies of the classes included in the bundle, and generated imports for the referenced packages (or, in the case of Conditional-Package, adds those packages to the bundle). Whereas the libraries specified in the POM are just the ones that

Re: managing OSGi Dependencies

2014-10-24 Thread Neil Bartlett
Sure, here you go: https://github.com/njbartlett/jscience.example The only change to your code was to move it out of the default package. Regards, Neil From: Pedro Domingues Reply: Pedro Domingues > Date: 24 October 2014 at 23:14:48 To: users@felix.apache.org >, Neil Bartlett > Subject:  Re:

RE: managing OSGi Dependencies

2014-10-24 Thread Paulo Renato de Athaydes
You're playing with fire. Not providing all the dependencies at runtime that a library requires at compiling time is recipe for ClassDefNotFoundException which has plagued OSGi devs since the beginning of time. > Subject: Re: managing OSGi Dependencies > From: pedro.doming...@ist.utl.pt > Date:

Re: managing OSGi Dependencies

2014-10-24 Thread Pedro Domingues
Could you share your example project so that I could get a closer look? Thanks! On October 24, 2014 5:25:36 PM WEST, Neil Bartlett wrote: >Further to this… I just created a Bndtools project to build a bundle >containing your sample “SuchInterface” interface, plus the entire >contents of the js

Re: SCR : Serve a Bean without interface

2014-10-24 Thread Charles Moulliard
Hi Neil, Thx for the clarification and explanation. You are right, without an interface, that means that we couple the producer and the consumer. Stupid thing indeed. Regards, On Fri, Oct 24, 2014 at 7:09 PM, Neil Bartlett wrote: > It depends what you mean by “expose”. > > You can register an

Re: SCR : Serve a Bean without interface

2014-10-24 Thread Neil Bartlett
It depends what you mean by “expose”. You can register an object as a service, yes, but if it’s not implementing an interface, what kind of service will it be? You can only register it as its own type or as java.lang.Object. This is not very useful except in rare edge-cases. If you publish it a

SCR : Serve a Bean without interface

2014-10-24 Thread Charles Moulliard
Hi, Would it be possible using Apache Felix SCR to expose a bean / class as a OSGI service ? REMARK : This class does not implement at all an interface. Regards, -- Charles Moulliard Apache Committer / Architect @RedHat Twitter : @cmoulliard | Blog : http://cmoulliard.github.io

Re: managing OSGi Dependencies

2014-10-24 Thread Neil Bartlett
Further to this… I just created a Bndtools project to build a bundle containing your sample “SuchInterface” interface, plus the entire contents of the jscience.jar version 4.3.1 pulled from Maven Central. The only imported package was org.xml.sax, which as I said is provided by JavaSE. So there

Re: managing OSGi Dependencies

2014-10-24 Thread Neil Bartlett
The Conditional-Package instruction is documented here:  http://bnd.bndtools.org/chapters/800-headers.html. There is no need to restrict yourself to reading only the maven-bundle-plugin documentation. All instruction and headers supported by bnd are supported by the Maven plugin, because the plu

Re: managing OSGi Dependencies

2014-10-24 Thread Neil Bartlett
Hello Pedro, To help you I’d first like to understand your current approach a bit better. You say you download these non-bundle dependencies and put them in the “bundle” directory until you get no more dependency errors. What effect does that have? Since they are not bundles, how does adding th

Re: managing OSGi Dependencies

2014-10-24 Thread Christian Schneider
I think this is an effect of the problem that people writing libraries depend too much on other libraries. One thing you should consider is if you really want to build upon a library that needs so many further dependencies. In some case you can not avoid it but you should limit these cases to

managing OSGi Dependencies

2014-10-24 Thread PedroD
Greetings, I’m using Felix Framework for my OSGi project, but I’ve came across a severe problem concerning third party dependencies. I’m using eclipse and maven-bundle-plugin to generate my bundles from the sources and the MANIFEST.MF from the POM.XML file. So far so good. however when I have