apache / logging-log4j-kotlin

A Kotlin-friendly interface to log against the Log4j API
https://logging.apache.org/log4j/kotlin
Apache License 2.0
46 stars 12 forks source link

Ensure OSGi compatibility #13

Closed roedll closed 3 years ago

roedll commented 3 years ago

We are using the Log4J Kotlin API in an OSGi environment. One pitfall is the missing manifest headers that would enable the direct usage as OSGi bundle. We are currently working with a workaraound, that wraps (repackages) the jar as a bundle and adds those headers on the fly. But "native" support would be way better ;-)

To use a jar as an OSGi bundle, the manifest needs to have additional headers. These headers describe the bundle and provide additional information.

This MR adds those headers and some additional Maven configuration to automaitcally add those headers into the resulting MANIFEST.MF file.

Some resources that deal with OSGi, manifest headers and "bundelization":

rocketraman commented 3 years ago

Thanks for this. I'd like to see the bnd definition file in a subdirectory rather than at the root e.g. bnd/log4j-kotlin-api.bnd

    <configuration>
        <bndfile>bnd/log4j-kotlin-api.bnd</bndfile>
    </configuration>
roedll commented 3 years ago

No problem - Done

roedll commented 3 years ago

The standard path for bnd metadata seems to be the "\/bnd.bnd" (like defined here https://bnd.bndtools.org/md/805-instructions.html in section "Headers")

I've now synchronized it with the "artifactId"... It's now "\/bnd/\.bnd"

rocketraman commented 3 years ago

@jvz This PR LGTM. Are there any hoops we need to jump through before merging?

jvz commented 3 years ago

Nah, go ahead. There might be some OSGi bugs in Log4j itself, but those would be handled separately.

On Wed, Nov 11, 2020 at 08:16 Raman Gupta notifications@github.com wrote:

@jvz https://github.com/jvz This PR LGTM. Are there any hoops we need to jump through before merging?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/apache/logging-log4j-kotlin/pull/13#issuecomment-725447578, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGBF265BBP5XUQGVR5SFCTSPKMEFANCNFSM4TQ5U62A .