Return-Path: Delivered-To: apmail-incubator-felix-dev-archive@www.apache.org Received: (qmail 89167 invoked from network); 5 Dec 2006 08:28:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Dec 2006 08:28:26 -0000 Received: (qmail 22362 invoked by uid 500); 5 Dec 2006 08:28:34 -0000 Delivered-To: apmail-incubator-felix-dev-archive@incubator.apache.org Received: (qmail 22326 invoked by uid 500); 5 Dec 2006 08:28:34 -0000 Mailing-List: contact felix-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: felix-dev@incubator.apache.org Delivered-To: mailing list felix-dev@incubator.apache.org Received: (qmail 22314 invoked by uid 99); 5 Dec 2006 08:28:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Dec 2006 00:28:33 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=BIZ_TLD X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [65.254.51.34] (HELO server6.tchmachines.com) (65.254.51.34) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Dec 2006 00:28:21 -0800 Received: from amontpellier-156-1-37-214.w90-0.abo.wanadoo.fr ([90.0.68.214] helo=zeta) by server6.tchmachines.com with esmtpa (Exim 4.52) id 1GrVhK-0003Cs-A2; Tue, 05 Dec 2006 03:30:42 -0500 Date: Tue, 5 Dec 2006 09:27:49 +0100 From: Peter Kriens X-Mailer: The Bat! (v3.71.03) Home Organization: aQute X-Priority: 3 (Normal) Message-ID: <1128149406.20061205092749@aQute.biz> To: =?iso-8859-1?Q?Emil_Eifr=E9m?= CC: felix-dev@incubator.apache.org Subject: Re[2]: Bundle plugin: Importing packages from non-bundles In-Reply-To: References: <1231377400.20061204075439@aQute.biz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server6.tchmachines.com X-AntiAbuse: Original Domain - incubator.apache.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - aQute.biz X-Source: X-Source-Args: X-Source-Dir: X-Virus-Checked: Checked by ClamAV on apache.org Well, the manifest is fine. You never told the plugin to include the commons, so that is another story. :-) EE> 1. Detect as many problems as possible at compile-time. This means EE> we're not too thrilled about the resolution:=optional solution. EE> Runtime exceptions is not good enough. You can't have your cake and it too ... In that case you must ensure ALL your dependencies are met. Fine with me, its the model I use. However, it means you will have to know exactly what you link to. EE> 2. The POM is the definitive resource for information about a EE> project's configuration. All other configuration resources (Eclipse EE> files, OSGi manifests) should be generated from it. Great, so skip the PDE and use the JDE, saves a lot of pain. The JDE does NOT use the manifest.mf file. EE> 3. Never ever add a feature (to the build infrastructure) if it EE> means we have to update the same information in more than one place EE> for frequent changes. (Everything more often than "once per month" is EE> frequent.) You're a man to my heart, though once a year would have put you in even higher standing :-) EE> So in our case the POM knows everything about the project. This means EE> that ALL dependencies for our source files are listed in the POM. And EE> this means that the plugin should be able to just do the Right EE> Thing(tm), which in our view is to take dependencies with EE> bundle, analyze them and generate Import-Package EE> statements for them; and take dependencies with jar, add EE> them to Bundle-Classpath and embed them in the bundle. I now see you want to include all your dependencies into one big jar, which of course in the OSGi component model is far from ideal :-( I guess what you are looking for is a possibility to specify the artifacts that should be placed on the bundle classpath? I am not sure I can just take all the provided artifacts because I am sure there are people who want to make finer grained components. Would inline the jars work for you? It is more efficient on the framework than including the jar and specifying the Bundle-Classpath header. You can inline with Include-Resource but this means you need to specify the dependencies twice and it requires knowing the Maven path names, both are very unpleasant. So we could add the artifacts that should be inlined without redundantly specifying the dependents. Proposal: include-maven ::= clause ( ',' clause ) * clause ::= MATCH ( ';' attr '=' MATCH ) attr ::= 'version' | 'scope' MATCH ::= Defaults for attributes = '*', matching all. I could use this header to find out all specified dependent artifacts and add their paths to the Include-Resource header as inlined artifacts. In your case you would add for example: *;scope=provided Assuming bnd and commons were your dependencies then this would be translated to something like: @/home/pkriens/.m2/biz/aQute/bnd-0.0.105/bnd-0.0.105.jar, @/home/pkriens/.m2/apache/commons/commons-2.2.33/commons-02.2.33.jar Do I understand you correctly now and would this work? Kind regards, Peter Kriens EE> This should solve our problems. I realize this is not for all. Some EE> people don't have all information in the POM, others have all jar EE> files as bundles. But the above functionality combined with the EE> behavior for provided seems to cover all bases. EE> Hi Peter. Thanks for your reply. EE> On 12/4/06, Peter Kriens wrote: >> The manifest looks fine, there seems to be no bundle exporting the >> org.apache.commons.logging package. EE> Actually, in our case it's more like: EE> "The manifest DOESN'T look fine, because there is no bundle EE> exporting the org.apache.commons.logging package." EE> [snip] >> If you have suggestions for >> improving the plugin/bnd then please let me know. >> EE> Yes, we do lack a feature that would make our lives easier. EE> First off, we have a few simple principles for our build environment. EE> In fact, we have a bunch but here's the gist as relevant for this EE> discussion: EE> 1. Detect as many problems as possible at compile-time. This means EE> we're not too thrilled about the resolution:=optional solution. EE> Runtime exceptions is not good enough. EE> 2. The POM is the definitive resource for information about a EE> project's configuration. All other configuration resources (Eclipse EE> files, OSGi manifests) should be generated from it. EE> 3. Never ever add a feature (to the build infrastructure) if it EE> means we have to update the same information in more than one place EE> for frequent changes. (Everything more often than "once per month" is EE> frequent.) EE> So in our case the POM knows everything about the project. This means EE> that ALL dependencies for our source files are listed in the POM. And EE> this means that the plugin should be able to just do the Right EE> Thing(tm), which in our view is to take dependencies with EE> bundle, analyze them and generate Import-Package EE> statements for them; and take dependencies with jar, add EE> them to Bundle-Classpath and embed them in the bundle. EE> This should solve our problems. I realize this is not for all. Some EE> people don't have all information in the POM, others have all jar EE> files as bundles. But the above functionality combined with the EE> behavior for provided seems to cover all bases. EE> Am I missing something? EE> Cheers, EE> -EE -- Peter Kriens Tel +33467542167 9C, Avenue St. Dr�z�ry AOL,Yahoo: pkriens 34160 Beaulieu, France ICQ 255570717 Skype pkriens Fax +1 8153772599