One-Jar and service loader

  • Paolo Di Tommaso


    I'm experiencing a problem while packaging a Java application with One-Jar in which a dependency JAR uses the Java ServiceLoader mechanism to provide its service.

    In short, when this JAR it is embedded in the One-Jar packaged app the the service it is not loaded (apparently the class-loader it is unable to access the META-INF/services/descriptor file in the embedded JAR).

    Is there any way or workaround to handle this?

    Best and thanks for your tool.

  • Tom Eugelink

    Tom Eugelink - 2013-12-07

    Same problem here.

  • Gus Heck

    Gus Heck - 2014-05-19

    Seems this is likely to be related to my recently reported issue:

    You might try promoting the services descriptor to the top level of the onejar as a workaround. That worked for my use case (though I'm not using ServiceLoader so YMMV)


Log in to post a comment.