Return-Path: X-Original-To: apmail-felix-users-archive@minotaur.apache.org Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 73321228F for ; Sun, 1 May 2011 22:55:07 +0000 (UTC) Received: (qmail 52047 invoked by uid 500); 1 May 2011 22:55:06 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 52014 invoked by uid 500); 1 May 2011 22:55:06 -0000 Mailing-List: contact users-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@felix.apache.org Delivered-To: mailing list users@felix.apache.org Received: (qmail 52006 invoked by uid 99); 1 May 2011 22:55:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 May 2011 22:55:06 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mcculls@gmail.com designates 209.85.216.170 as permitted sender) Received: from [209.85.216.170] (HELO mail-qy0-f170.google.com) (209.85.216.170) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 May 2011 22:55:00 +0000 Received: by qyk32 with SMTP id 32so1681270qyk.1 for ; Sun, 01 May 2011 15:54:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=b3VYnky3IR605/udaKrQk0zyiUHpNMkTc6XLocwKDek=; b=JGOiSyxX67ikEHpQK6wVmOGixQS3jtg+KB8s+OHACdgJoKuqOQjAItr60rXO5heeHg wODR1eaPiuWKF3GBr5FO5lukUrHGfLMTnpgPc2EL9tjLNBn0APaz5Fgj1P14yOOqOVOv wBj/0G0s00eP6OawGISpnntbXT38CqU4fsyjE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=b/DKzsUtwAttCONBdne7ki7Iql49Kl4GIwBsIzYc6YzdOFRP2vsXHySHsxXNV7xbiK qLqM1vGeAgztzBipn57yFLoD1P7dXmcxwAizCByjIHFFdxpr9rXwQYQ5wvLJtt9wx1o5 x3Fgo0+EmPTYoZUWW0eurF/eITKRkz0pr3NTc= MIME-Version: 1.0 Received: by 10.229.127.144 with SMTP id g16mr5540829qcs.152.1304290477726; Sun, 01 May 2011 15:54:37 -0700 (PDT) Received: by 10.229.188.194 with HTTP; Sun, 1 May 2011 15:54:37 -0700 (PDT) In-Reply-To: References: Date: Sun, 1 May 2011 23:54:37 +0100 Message-ID: Subject: Re: maven-bundle-plugin and .impl and .internal packages From: Stuart McCulloch To: users@felix.apache.org Content-Type: multipart/alternative; boundary=000e0cd5bbea9bdb5304a23ecad5 --000e0cd5bbea9bdb5304a23ecad5 Content-Type: text/plain; charset=ISO-8859-1 On 1 May 2011 17:37, Yuri de Wit wrote: > Thanks for the answer, Stuart. > > I did read the documentation and followed the instructions there, but > although I had an Export-Package setting it was not being picked up. > > It turns out that the issue had nothing to do with > maven-bundle-plugin, but self-inflicted with a little "help" from > maven. I had the plugin configured twice in my parent pom's > pluginManagement (it's a few pages long) and maven was silently > ignoring the first one, which had all the settings. In my bundle > configuration I had: > > > !${project.groupId}.${project.artifactId}.internal.*,${project.groupId}.${project.artifactId}.* > > ${project.groupId}.${project.artifactId}.internal.* > > Removing the dup one fixed the problem. > FYI, I find "mvn help:effective-pom" helps to solve these sorts of problems, since it shows you the final merged pom > I also added a bit of logging to BundlePlugin and ManifestPlugin to > help track what it is actually doing and double check it was doing > what I wanted: > Cool - we already do some logging of what gets sent to bnd and what comes back, but you need to add "-X" to see it (unfortunately this also produces a lot of other maven related debug output) > [INFO] Writting MANIFEST.MF to > /Users/joe/Workspaces/hello/hello.bundles/hello.core/META-INF/MANIFEST.MF > ... > > thanks, > -- yuri > > On Sun, May 1, 2011 at 7:52 AM, Stuart McCulloch > wrote: > > On 30 April 2011 23:47, Yuri de Wit wrote: > > > >> I have been going in circles trying to figure out why certain packages > >> weren't being exported until I noticed, after taking a look at the > >> sources, that the maven-bundle-plugin seems to be skipping .impl and > >> .internal packages. > > > > > > That's correct - if you don't define any Export-Package then it defaults > to > > the local non-internal / non-impl packages, as described in the "Default > > Behavior" section: > > > > http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html > > > > After I renamed my package to something else it > >> worked as expected. > >> > >> Is this restriction imposed by the OSGi specs? Although in theory > >> .impl means an internal package it is not always the case. Renaming > >> the package is an option, but seems a bit invasive (specially without > >> knowing a good reason for it to be the way it is). Last, is there a > >> simple work around for this beyond renaming the package? > >> > > > > There is nothing in the specs that restrict implementation packages from > > being exported, the bundleplugin defaults are based on user feedback > > and current best-practice. But they are only defaults - if you want to > > export internal packages then you can do so by explicitly setting > > Export-Package (or _exportcontents if you're exporting packages from > > embedded JARs, see the above link and FAQ for more details). > > > > Though ideally you wouldn't want to export implementation packages, since > > one benefit of modularity is that you can hide away internal / > > implementation details and instead communicate via interfaces and > services. > > That way you get loose coupling, and substitutable bundles. > > > > > >> -- yuri > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org > >> For additional commands, e-mail: users-help@felix.apache.org > >> > > > > -- > > Cheers, Stuart > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org > For additional commands, e-mail: users-help@felix.apache.org > --000e0cd5bbea9bdb5304a23ecad5--