Unnecessary "Import-Package"-Headers in MANIFEST.MF

Issue #386 resolved
Former user created an issue

In version 9.1.2 the manifest file of Nimbus-JOSE JAR contains the following "Import-Package" headers:

net.minidev.json;version="[1.3,2)", net.minidev.json.parser;version="[1.3,2)"

As far as I can see the dependency on "json-smart" has been shaded recently (see issue #239). Further, the pom file doesnt contain any direct dependency on "json-smart". These headers should not be necessary. In fact, if I try to use the 9.1.2 version in an OSGI-environment I get resolution errors because the above "Import-Package" statements cannot be satisfied. Please remove these headers.

Comments (8)

  1. Yavor Vasilev

    Do you have an idea what needs to change in pom.xml to remove the json-smart from the header?

  2. Arnaud Mergey

    I think this header is set because of this dependency declared in pom.xml.

    It should be removed if json-smart is unecessary or at least set as optional

    <dependency>
    <groupId>net.minidev</groupId>
    <artifactId>json-smart</artifactId>
    <version>1.3.1</version>
    </dependency>

  3. Yavor Vasilev

    Oh, I see.

    The json-smart dependency is not optional. It is used for all JSON parsing and output operations.

    It has made “shadowed”, to prevent dep conflicts in projects.

    Maybe that’s causing the OSGI error?

  4. Arnaud Mergey

    Yes

    So in this case to fix osgi metadata you should add this in the pom.xml (around line 283 inside instructions of maven-bundle-plugin plugin configuration):

    <Import-Package>net.minidev.json*;version="1.3";resolution:=optional,*</Import-Package>
    

    Or maybe better exclude net.minidev if it is not necessary at all at runtime:

    <Import-Package>!net.minidev.json*,*</Import-Package>
    

  5. Vladimir Dzhuvinov

    Hi Arnaud,

    I suppose the second option is the proper one. The dep gets shaded inside the Nimbus JAR, so it shouldn’t be really declared as runtime dep, and not even optional.

  6. Vladimir Dzhuvinov

    Hm, for some reason the Maven Central stating failed, with

    [ERROR] Rule failure while trying to close staging repository with ID "comnimbusds-1939".
    

  7. Vladimir Dzhuvinov

    Check out version 9.1.5.

    The staging hiccup was apparently caused by Maven Central experiencing a bit of an overload today.

    If there are still issues reopen the ticket.

  8. Log in to comment