Lets start over.

I'd like an way to get a package version for the packages in a bundle into the Export-Packages and Import-Packages when using the maven- bundle-plugin 2.0.0 or later, preferably without writing out these entries in the plugin configuration. Also, the behavior of this plugin appears to have changed radically between 1.4.3 and 2.0.0 and configurations that used to produce reasonable results now produce nonsense.

I'll only show the manifest entries of interest to save space.

First, supplying no configuration produces reasonable results that only lack the version for the packages in the bundle:

configuration:
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>2.0.0</version>
          <extensions>true</extensions>
          <configuration>
            <instructions>
           </instructions>
          </configuration>
        </plugin>


manifest entries;
Export-Package: javax.portlet.filter;uses:="javax.portlet,javax.xml.na
 mespace,javax.servlet.http,org.w3c.dom",javax.portlet;uses:="javax.xm
 l.namespace,javax.servlet.http,org.w3c.dom"
Import-Package: javax.portlet,javax.portlet.filter,javax.servlet.http;
 version="2.5",javax.xml.namespace,org.w3c.dom

What I'd like is some way to specify the version of the javax.portlet and javax.portlet.filter packages in the Export-Package and Import- Package headers without altering the uses clauses in the Export- Package header.

I imagine the result would look something like this:
Export-Package: javax.portlet.filter;uses:="javax.portlet,javax.xml.na
mespace ,javax .servlet.http,org.w3c.dom";version="2.0",javax.portlet;uses:="javax.xm
 l.namespace,javax.servlet.http,org.w3c.dom";version="2.0"
Import-Package: javax .portlet ;version="2.0",javax.portlet.filter;version="2.0",javax.servlet.http;
 version="2.5",javax.xml.namespace,org.w3c.dom

----------------------------------------------------
I tried copying the configuration style used in the geronimo spec bundles.

configuration:
  <properties>
    <portals.osgi.import.pkg>*</portals.osgi.import.pkg>
    <portals.osgi.export.pkg>*</portals.osgi.export.pkg>
    <portals.osgi.private.pkg/>
<portals.osgi.export>!META-INF*,$ {portals.osgi.export.pkg}*;version=${portals.osgi.export.version}</ portals.osgi.export>
    <portals.osgi.export.version>2.0</portals.osgi.export.version>
<portals.osgi.import>!META-INF*,${portals.osgi.import.pkg}</ portals.osgi.import> <portals.osgi.symbolic.name>${groupId}.${artifactId}</ portals.osgi.symbolic.name>
    <bnd.version.policy>$(version;==;$(@))</bnd.version.policy>
  </properties>
...
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>2.0.0</version>
          <extensions>true</extensions>
          <configuration>
            <instructions>
              <Export-Package>${portals.osgi.export}</Export-Package>
              <Import-Package>${portals.osgi.import}</Import-Package>
<Private-Package>${portals.osgi.private.pkg}</Private- Package>
              <_versionpolicy>${bnd.version.policy}</_versionpolicy>
            </instructions>
          </configuration>
        </plugin>

manifest entries:
Export-Package: javax.servlet;version="2.0",javax.portlet.filter;uses:
 ="javax.portlet,javax.xml.namespace,javax.servlet.http,org.w3c.dom";v
 ersion="2.0",javax.portlet;uses:="javax.xml.namespace,javax.servlet.h
 ttp,org.w3c.dom";version="2.0",javax.servlet.http;uses:="javax.servle
 t";version="2.0",javax.servlet.resources;version="2.0"
Import-Package: javax.portlet;version="2.0",javax.portlet.filter;versi
 on="2.0",javax.servlet;version="2.5",javax.servlet.http;version="2.5"
 ,javax.servlet.resources;version="2.5",javax.xml.namespace,org.w3c.do
 m

There are several problems with this that I can see:
- too many imports
- exports include all imports, not just stuff in the bundle itself
- version 2.0 is applied to all exports, even the imports that are imported with a different version.


If I go back to 1.4.3 I get more reasonable results:

configuration:
same as above except using plugin v. 1.4.3

manifest entries:

Export-Package: javax.portlet.filter;uses:="javax.portlet,org.w3c.dom,
 javax.servlet.http,javax.xml.namespace";version="2.0",javax.portlet;u
 ses:="org.w3c.dom,javax.servlet.http,javax.xml.namespace";version="2.
 0"
Import-Package: javax.portlet;version="2.0",javax.portlet.filter;versi
 on="2.0",javax.servlet.http,javax.xml.namespace,org.w3c.dom

The only problem I see here is that the import of the servlet package doesn't have a version.

---------------------------------------------------------------

Just in case anyone reads this far, I reiterate: my goal is to specify the version of the packages in the current bundle and have this show up in the Export-Packages and Import-Packages headers, something like this:

Export-Package: javax.portlet.filter;uses:="javax.portlet,javax.xml.na
mespace ,javax .servlet.http,org.w3c.dom";version="2.0",javax.portlet;uses:="javax.xm
 l.namespace,javax.servlet.http,org.w3c.dom";version="2.0"
Import-Package: javax .portlet ;version="2.0",javax.portlet.filter;version="2.0",javax.servlet.http;
 version="2.5",javax.xml.namespace,org.w3c.dom

Do I have to write out these headers in their entirety in the plugin configuration or is there some way to simply add the version to the automatically generated headers?

thanks
david jencks




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to