dev@glassfish.java.net

Re: [GFv3] maven-bundle-plugin configuration

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Tue, 26 Aug 2008 15:47:38 -0700

Sahoo wrote:
> I have refactored maven-bundle-plugin configuration to a parent pom.
> This allows better control over the plugin's execution. e.g.:
> 1. The plugin version is specified in one place only, i.e., v3/pom.xml.
> 2. The plugin is configured once to execute manifest goal.
> 3. All per artifact plugin instructions are now read from a
> corresponding file called *osgi.bundle*, which resides next to each
> pom.xml. We were not able to do this earlier because of bug [1].
>
> From now on, when you want to change any Export-Package or
> Import-Package or any other OSGi metadata for your artifact in v3 repo,
> please use *osgi.bundle* file. The file format is documented at [2].
>
> Thanks,
> Sahoo
>
> [1] https://issues.apache.org/jira/browse/FELIX-620
> [2] http://www.aqute.biz/Code/Bnd#format

What's the impact of this on those of us managing our own use
of maven-bundle-plugin? Are any changes required? Desired?
For example, here's what I have in my pom.xml for JavaMail:


             <!--
                 This plugin is reponsible for packaging artifacts
                 as OSGi bundles. Please refer to
                 http://felix.apache.org/site/maven-bundle-plugin-bnd.html
                 for more information about how to use this plugin.
             -->
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
                     <instructions>
                         <Export-Package>
                             ${mail.packages.export}
                         </Export-Package>
                         <Private-Package>
                             ${mail.packages.private}
                         </Private-Package>
                         <!--
                             The following entry makes this jar an HK2 jar as
                             well. This is needed because GlassFish currently
                             picks up only OSGi bundles that have this entry.
                             Remove this when GlassFish does not have this
                             limitation.
                         -->
                         <HK2-Bundle-Name>
                              ${project.groupId}:${project.artifactId}
                         </HK2-Bundle-Name>
                     </instructions>
                 </configuration>
                 <!--
                     Since we don't change the packaging type to bundle, we
                     need to configure the plugin to execute the manifest goal
                     during the process-classes phase of the build life cycle.
                 -->
                 <executions>
                     <execution>
                         <id>osgi-manifest</id>
                         <phase>process-classes</phase>
                         <goals>
                             <goal>manifest</goal>
                         </goals>
                     </execution>
                 </executions>
             </plugin>