-
-
Notifications
You must be signed in to change notification settings - Fork 304
Description
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:
error_prone_annotationsonly requires Java 8, while the rest of the suite requires Java 21.spotbugs-annotationsrolled back their baseline change in spotbugs-annotations 4.9.1+ prevents--release 8Gradle builds spotbugs/spotbugs#3497.