dev@glassfish.java.net

Re: exporting no packages (Re: Wiki page with OSGi package statistics for various glassfish bundles)

From: Bill Shannon <bill.shannon_at_oracle.com>
Date: Tue, 11 May 2010 21:00:12 -0700

Bobby Bissett wrote on 05/11/2010 07:48 AM:
>> Why is it using
>> <packaging>hk2-jar</packaging>
>> instead of
>> <packaging>jar</packaging>
>> if it is supposed to be a plain jar?
>
> I don't have any simple way of finding that out. But I'm guessing
> someone said the jar should be in the modules dir, someone else said
> "take a look at this example," etc, etc, and here we are.
>
> If I make that change, the exported packages go away. But so does most
> of the manifest, including the manifest classpath. Without that things
> fall apart since I depend on some external jars. So someone who knows
> maven want to suggest something?

I'm sure you can configure the maven jar plugin to create a
Class-Path header in the manifest. I use this to configure
manifest entries for JavaMail:

             <plugin>
                 <artifactId>maven-jar-plugin</artifactId>
                 <configuration>
                     <finalName>${project.artifactId}</finalName>
                     <archive>
                         <!--
                             Configure the maven-jar-plugin to pick up
                             META-INF/MANIFEST.MF that's generated by
                             the maven-bundle-plugin.
                         -->
                         <manifestFile>
                           ${project.build.outputDirectory}/META-INF/MANIFEST.MF
                         </manifestFile>
                         <manifestEntries>
                             <Extension-Name>
                                 ${mail.extensionName}
                             </Extension-Name>
...