Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 29285 invoked from network); 15 Nov 2009 05:05:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Nov 2009 05:05:49 -0000 Received: (qmail 65243 invoked by uid 500); 15 Nov 2009 05:05:49 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 65050 invoked by uid 500); 15 Nov 2009 05:05:48 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 65042 invoked by uid 99); 15 Nov 2009 05:05:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Nov 2009 05:05:47 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jgawor@gmail.com designates 209.85.218.218 as permitted sender) Received: from [209.85.218.218] (HELO mail-bw0-f218.google.com) (209.85.218.218) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Nov 2009 05:05:45 +0000 Received: by bwz10 with SMTP id 10so4847875bwz.35 for ; Sat, 14 Nov 2009 21:05:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=JwN6rtO/qKjDOYsOfP7QCK/eaxvyTIKAjip4OuEYrDs=; b=jOT8BxJzXchqj8DStGA4XkY625p1Y1vgH3OUl04/MrD2TRFFTLxtv3pmKeRorb2Wl0 rHZA6f+5oMmq4y1FKEXNinrFThEeJ/bkrez3cBxPYjiVFdYrmOci+R1J3c5XlMKjRl2C D4zUKazuBrfc5NlcF3C99a3KHZwUoM1NA7SUg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=bBTlsBxtOIC9nnFyrRM8hnwN5cMvc7ANFOvd+R2GRhDPTvIShosMb0fj1EgxTOX/ad QiHVDClkUG6MpEiJx1nmat7EdvQbBr3334Br3z6KvWelqPNQnwtTkvxI54LAerEWYmrQ R8ABLgmpA4Dk1KgDJMFUMR6OHJUyUDVLk5eRo= MIME-Version: 1.0 Received: by 10.204.6.65 with SMTP id 1mr2383996bky.186.1258261523927; Sat, 14 Nov 2009 21:05:23 -0800 (PST) Date: Sun, 15 Nov 2009 00:05:23 -0500 Message-ID: <5eb405c70911142105v7187d5e4w95197ba953c9b56@mail.gmail.com> Subject: Geronimo 3.0: verifying generated manifests From: Jarek Gawor To: dev Content-Type: text/plain; charset=ISO-8859-1 Hey, I added a small plugin that verifies the generated manifest against the dependencies (bundles). It uses the eclipse API to validate the manifest so it's following the OSGi rules. Hopefully, this should help us detect problems sooner at build time. For example, it catches a problem where the code uses some class from non-exported package. The complication would be successful but at runtime you would see resolution problems. Right now the plugin is only enabled for modules in framework but we could enable it for all plugins. Also, any problems are reported as warnings (so it doesn't break the build). Also, the plugin contains display-manifest goal that displays import and export packages in the manifest. I just got tired of reading the manifest file in emacs (yes, i know I could open it in IDE too). To display the import/export packages run the following (once the code is compiled and the manifest files are generated): mvn org.apache.geronimo.buildsupport:geronimo-osgi-plugin:display-manifest Btw, the plugin borrows a bunch of code from the Tuscany Maven Eclipse Compiler module. And I might eventually donate this plugin back to Tuscany. Side note: The Eclipse JDT compiler supports specifying "access rules" on each classpath component. With these access rules you can specify which classes or packages the compiler can see. The Export-Package header in manifest of the dependencies could be translated into the right set of access rules. With that in place we could catch the package visibility issues right at compile time. The plexus-compiler-eclipse and Tuscany's maven-eclipse-compiler compiler plugins for maven-compiler-plugin do not support access rules. The tycho-compiler-jdt compiler plugin has some support for it but they are not automatically derived from the dependencies - must be passed explicitly. Tycho's maven-osgi-compiler-plugin has support for access rules but requires Maven 3.0 and I think it needs Eclipse specific build files. Anyway, maybe this is something we want to look into in the future. For now the manifest checking should be good enough. Jarek