felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Bosschaert <david.bosscha...@gmail.com>
Subject [maven-bundle-plugin] How to avoid version numbers on imported packages?
Date Fri, 23 Jan 2015 15:51:08 GMT
Hi all,

I'm using maven-bundle-plugin 2.5.3 to create a bundle the uses the
javax.servlet APIs. As explained in [1] I want to use a portable
contract for the javax.servlet package, as defined in [2].
I can easily require the contract using the maven bundle plugin, but
what I can't seem to achieve is import the javax.servlet package
without a version range. My maven bundle plugin configuration looks
like this:

  <configuration>
    <instructions>
      <Import-Package>javax.servlet,javax.servlet.http</Import-Package>
      <Require-Capability>osgi.contract;filter:="(&amp;(osgi.contract=JavaServlet)(version=3.0))"</Require-Capability>
    </instructions>
  </configuration>

However, the import package is always generated *with* version
numbers, I always get somthing like:
  Import-Package:
javax.servlet;version="[3.0,4)",javax.servlet.http;version="[3.0,4)"

As explained in [1] and [2], for packages defined by organisations
that do not follow semantic versioning I should import the package
without version and let the osgi.contract require-capability associate
it with the right version for me.

Question is, how do I configure the maven bundle plugin to avoid these
versions on imported packages?

Thanks,

David

[1] http://blog.osgi.org/2014/09/portable-java-contracts-for-javax.html
[2] http://www.osgi.org/Specifications/ReferenceContract

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message