Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 98627 invoked from network); 2 Jul 2007 08:59:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jul 2007 08:59:23 -0000 Received: (qmail 1542 invoked by uid 500); 2 Jul 2007 08:59:25 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 1510 invoked by uid 500); 2 Jul 2007 08:59:25 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 1500 invoked by uid 99); 2 Jul 2007 08:59:25 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jul 2007 01:59:25 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [194.138.12.131] (HELO mxs1.siemens.at) (194.138.12.131) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jul 2007 01:59:17 -0700 Received: from vies1kbx.sie.siemens.at ([158.226.129.82]) by mxs1.siemens.at with ESMTP id l628wrFZ010954 for ; Mon, 2 Jul 2007 10:58:53 +0200 Received: from nets138a.ww300.siemens.net ([158.226.129.98]) by vies1kbx.sie.siemens.at (8.12.11.20060308/8.12.1) with ESMTP id l628wh6B023911 for ; Mon, 2 Jul 2007 10:58:52 +0200 Received: from nets13ga.ww300.siemens.net ([158.226.250.76]) by nets138a.ww300.siemens.net with Microsoft SMTPSVC(6.0.3790.1830); Mon, 2 Jul 2007 10:58:33 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7BC87.2B2C81D0" Subject: Maven-bundle-plugin observations Date: Mon, 2 Jul 2007 10:58:33 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Maven-bundle-plugin observations Thread-Index: Ace8hysNUeehQTZ6T02jnxTJPVrKnQ== From: "Hampel, Michael" To: X-OriginalArrivalTime: 02 Jul 2007 08:58:33.0859 (UTC) FILETIME=[2B6E1530:01C7BC87] X-purgate: clean X-purgate: This mail is considered clean X-purgate-type: clean X-purgate-Ad: Checked for Spam by eleven - eXpurgate www.eXpurgate.net X-purgate-ID: 149917::070702105853-12486BB0-17BDEC49/0-0/0-15 X-purgate-size: 15981/0 X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C7BC87.2B2C81D0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, =20 after working a while now with the maven-bundle-plugin I would like to share some=20 observations and ask questions about them. =20 I am using the plugin in my poms for running to goals: manifest and bundle. In certain cases these two goals produce two different MANIFEST.MF files as regards context. =20 In the first case I have the following bundle structure: =20 Bundle A defines certain interfaces and exports them in a package org.a.messaging. Bundle B implements these interfaces and reexports them, so it imports org.a.messaging and exports org.a.messaging. The implementation classes in org.b.messaging.internal are kept "private" - not exported. If I have a maven-bundle plugin configuration for Bundle B that looks like this: =20 org.a.messaging =20 the manifest goal will create the following MANIFEST.MF file(excerpt): =20 ....... Private-Package: org.b.messaging.internal Import-Package: org.a.messaging, (plus all other import packages) ....... =20 The main problem is that their is no Export-Package entry in the generated MANIFEST.MF file. =20 The bundle goal on the other hand will generate the following MANIFEST.MF file(excerpt): =20 ...... Export-Package: org.a.messaging Import-Package: org.a.messaging, (additional import packages are MISSING!!) ..... =20 Here I don't get a Private-Package entry and I am missing several Import packages which are in the MANIFEST.MF file generated by the manifest goal - but I have an Export-Package entry:) The missing imported packages are referenced in the org.b.messaging.internal package classes. =20 What I did then - I added a Private-Package instruction to the pom of Bundle B: =20 =20 org.a.messaging org.b.messaging.internal.* =20 This did not change anything for the manifest goal - still no Export-Package entry in the MANIFEST.MF file - all other entries stayed the same. =20 The bundle goal on the other hand now created the following MANIFEST.MF file: =20 ......=20 Export-Package: org.a.messaging Private-Package: org.b.messaging.internal Import-Package: org.a.messaging, plus additional import packages ..... =20 So with this configuration I got the MANIFEST.MF file I wanted - with all necessary entries. =20 Is it necessary to state Private-Packages in contrast to only using the Export-Package instruction? =20 Another example is, if I have a bundle that has a BundleActivator class that is NOT in an exported package. The manifest goal will succeed and put the Activator in the MANIFEST.MF file. The bundle goal on the other side will fail with an Exception and complains about that the Activator class is not found on the classpath or any imported package. As I don't know which behaviour is the correct one regarding the OSGi spec (can I have a BundleActivator in a non exported package?), in the moment I exported the package. Are these two goals using different classpaths? =20 Sorry for this long post and that I had no time to look deeper in the maven-bundle-plugin implementation to find the reasons for the above mentioned behaviour - but I thought maybe this is interesting for others as well. =20 Thanx in advance for any help and answers, =20 michael =20 =20 ------_=_NextPart_001_01C7BC87.2B2C81D0--