Skip to content

biz.aQute.bnd.annotation bytecode level causes downstream build issues #7005

@ppkarwasz

Description

@ppkarwasz

Unlike most of the BND toolchain, biz.aQute.bnd.annotation types are referenced directly from compiled library bytecode.

In Apache Log4j, we build with JDK 17 and therefore use the latest BND release, but we must continue publishing artifacts with Java 8 bytecode compatibility. Recent log4j-api versions (Java 8 bytecode) expose a compileOnly dependency on biz.aQute.bnd.annotation, which is currently built with a Java 17 bytecode baseline.

As a result, users compiling with JDK 8 or 11 and -Xlint:classfile (often promoted to errors via -Werror) see compiler warnings or build failures due to the class file version mismatch.

While we can work around this by pinning an older annotation version, is there a reason biz.aQute.bnd.annotation (a pure annotation artifact) cannot be built with --release 8?

For context, other annotation libraries follow this approach:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions