#3585·feign

feign-form OSGi Export-Package header is incorrect

Author: diamondqCreated Sep 26, 2026Updated Sep 26, 2026

The current POM has the following:

xml
<plugin>
  <groupId>org.apache.felix</groupId>
  <artifactId>maven-bundle-plugin</artifactId>
  <configuration>
    <instructions>
      <Export-Package>feign.form</Export-Package>
      <Export-Package>feign.form.multipart</Export-Package>
    </instructions>
  </configuration>
</plugin>

Unfortunately, Maven Bundle plugin (and the underlying BND library), only process the 'final' Export-Package command. So, the MANIFEST.MF that is generated has the wrong Export-Package:

Export-Package: feign.form.multipart;version="13.16.0";uses:="feign.codec"

By changing it to:

xml
<plugin>
  <groupId>org.apache.felix</groupId>
  <artifactId>maven-bundle-plugin</artifactId>
  <configuration>
    <instructions>
      <Export-Package>feign.form,feign.form.*</Export-Package>
    </instructions>
  </configuration>
</plugin>

You end up with the correct MANIFEST.MF of:

Export-Package: feign.form;uses:="feign,feign.codec,feign.form.multipart";version="13.16.0",feign.form.multipart;version="13.16.0";uses:="feign .codec",feign.form.util;version="13.16.0"

Without this change, you can't add the FormEncoder to the Feign builder to add support for x-www-data-urlencoded within an OSGi environment, since FormEncoder is not exported.