Return-Path: Delivered-To: apmail-incubator-felix-dev-archive@www.apache.org Received: (qmail 66705 invoked from network); 10 Nov 2006 07:11:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Nov 2006 07:11:36 -0000 Received: (qmail 1372 invoked by uid 500); 10 Nov 2006 07:11:47 -0000 Delivered-To: apmail-incubator-felix-dev-archive@incubator.apache.org Received: (qmail 1336 invoked by uid 500); 10 Nov 2006 07:11:47 -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 1325 invoked by uid 99); 10 Nov 2006 07:11:46 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Nov 2006 23:11:46 -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; Thu, 09 Nov 2006 23:11:31 -0800 Received: from amontpellier-156-1-25-109.w90-0.abo.wanadoo.fr ([90.0.56.109] helo=zeta.home.aqute.biz) by server6.tchmachines.com with esmtpa (Exim 4.52) id 1GiQZk-0005rl-HJ; Fri, 10 Nov 2006 02:13:20 -0500 Date: Fri, 10 Nov 2006 08:11:04 +0100 From: Peter Kriens X-Mailer: The Bat! (v3.71.03) Home Organization: aQute X-Priority: 3 (Normal) Message-ID: <1408083014.20061110081104@aQute.biz> To: "Tim Moloney (JIRA)" CC: felix-dev@incubator.apache.org Subject: Re: [jira] Commented: (FELIX-171) Document process of creating bundles using bnd In-Reply-To: <11361060.1163080837676.JavaMail.jira@brutus> References: <7347096.1163079397003.JavaMail.jira@brutus> <11361060.1163080837676.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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 I see you create the transitive dependencies for maven but use import/export package for OSGi. I thought it would be sufficient to treat bundles as stand alone units? OBR can resolve the package dependencies in run time from a repository. Maintaining the transitive dependencies looks like a horrendous maintenance job. It means that if a downstream version changes, all the requirees must be changed. Another issue is optional dependencies. Many libraries are written that have a lot of optional dependencies. Bnd is a point in case. It requires Ant when it is used in the Ant context but it when it runs in Eclipse it should not require ant. These imports should be ignored or at least be optional. This implies that not all dependencies should be mandated. Note that a very important feature of the framework is that "your installed bundles are your configuration". The set of installed bundles is something you can play with. You want logging? Installer a logging bundle, but things should still work without. This flexibility is very much at odds with the hard transitive dependency model from maven. I do not claim I have all the answers, but personally I would lean to not make the bundles transitively depend on other bundles, I think that model is too static for OSGi. If that is the case, you could use bnd in build mode with only the specific bundle on the class path. The bnd file can contain the classpath (-classpath: LIST). Exporting all and importing all then does the trick, the bnd file can then set all the details like version, description. If you want to, I can support URLs for the -classpath which means you could directly load them from the net. I have written a small deploy tool for an ftp server, it would be easy to add an file server so you could deploy them to the maven repo without the support from maven. The conversion would then only consist of a bunch of bnd files, you could then daily do: bnd build *.bnd deploy -r file:~/.m2/repository *.jar The deploy automatically makes the POM file from the manifest information. Anyway, most important decision is how to handle the transitive dependencies. Very curious about your, Richard's and other opinions. This is a pretty import decision. Kind regards, Peter kriens TMJ> [ TMJ> http://issues.apache.org/jira/browse/FELIX-171?page=comments#action_12448473 ] TMJ> TMJ> Tim Moloney commented on FELIX-171: TMJ> ----------------------------------- TMJ> 1. Use bnd to analyze the library jar (e.g., java -jar TMJ> bnd-0.0.jar print path/to/FOO.jar) TMJ> 2. At the bottom of the bnd output, look for "Unresolved TMJ> references to ..." which identify package dependencies. If found, TMJ> a. Identifiy the library jars that provide the missing packages TMJ> b. Recursively use this process on each dependency TMJ> 3. Create a directory that will be the project directory for the bundle (e.g., mkdir FOO-osgi) TMJ> 4. Copy the template pom.xml file to the bundle's project directory TMJ> 5. Edit the pom.xml file to tailor it for the library jar. Specifically, TMJ> a. change artifactId TMJ> b. verify description TMJ> c. change version TMJ> d. change FOO's library jar dependency (groupId, artifactId) TMJ> e. add any other dependencies (from step 2b) TMJ> f. change Export-Package TMJ> g. change Private-Package or delete it if it's not needed TMJ> 6. Run "mvn package" to in the project directory to create the bundle TMJ> 7. Use bnd to verify the bundle's contents (e.g., java -jar TMJ> bnd-0.0.jar print target/FOO-osgi-VERSION.jar) TMJ> 8. Run "mvn install" to install the bundle in the local repository >> Document process of creating bundles using bnd >> ---------------------------------------------- >> >> Key: FELIX-171 >> URL: http://issues.apache.org/jira/browse/FELIX-171 >> Project: Felix >> Issue Type: Improvement >> Components: Felix Commons >> Environment: OSGi application development >> Reporter: Tim Moloney >> Priority: Trivial >> >> Provide the list of steps required to create a library bundle by wrapping the library jar using bnd (http://www.aqute.biz/Code/Bnd). -- Peter Kriens Tel +33467542167 9C, Avenue St. Drézéry AOL,Yahoo: pkriens 34160 Beaulieu, France ICQ 255570717 Skype pkriens Fax +1 8153772599