Skip to content

Upgrading 2.21.1 to 2.22.0 causes compilation failure on BaselineIgnore #2232

@big-andy-coates

Description

@big-andy-coates

Description

When updating log4j from v2.2.21.1 to v2.22., I see the build fail the following error:

/home/runner/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.22.1/bea6fede6328fabafd7e68363161a7ea6605abd1/log4j-api-2.22.1.jar(/org/apache/logging/log4j/Level.class): warning: Cannot find annotation method 'value()' in type 'BaselineIgnore': class file for aQute.bnd.annotation.baseline.BaselineIgnore not found

This looks to be related to this PR and specifically this commit, which adds the @BaselineIgnore annotation to the Level class.

For whatever reason, my build doesn't seem to be pulling in the annotation as a dependency and it doesn't like it. I'm not doing anything funky, just adding a Gradle dependency:

val log4jVersion = "2.22.0"

dependencies {
    ...
    implementation("org.apache.logging.log4j:log4j-core:$log4jVersion")
    runtimeOnly("org.apache.logging.log4j:log4j-slf4j2-impl:$log4jVersion")
    ...
}

Any ideas?

Configuration

Version: moving from 2.21.1 to 2.22.0

Operating system: MacOS locally and Linux GitHub Runner

JDK: adopt JDK 17

Logs

Run ./gradlew build coveralls --stacktrace
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :buildSrc:generateExternalPluginSpecBuilders
> Task :buildSrc:extractPrecompiledScriptPluginPlugins
> Task :buildSrc:compilePluginsBlocks

> Task :buildSrc:generatePrecompiledScriptPluginAccessors
Project : => no module-info.java found

> Task :buildSrc:generateScriptPluginAdapters
> Task :buildSrc:pluginDescriptors
> Task :buildSrc:processResources
> Task :buildSrc:compileKotlin
> Task :buildSrc:compileJava NO-SOURCE
> Task :buildSrc:compileGroovy NO-SOURCE
> Task :buildSrc:classes
> Task :buildSrc:jar
> Task :buildSrc:inspectClassesForKotlinIC

> Task :compileJava
/home/runner/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.22.1/bea6fede63[28](https://github.com/creek-service/json-schema-validation-comparison/actions/runs/7632745461/job/20793563134?pr=123#step:7:29)fabafd7e6836[31](https://github.com/creek-service/json-schema-validation-comparison/actions/runs/7632745461/job/20793563134?pr=123#step:7:32)61a7ea6605abd1/log4j-api-2.22.1.jar(/org/apache/logging/log4j/Level.class): warning: Cannot find annotation method 'value()' in type 'BaselineIgnore': class file for aQute.bnd.annotation.baseline.BaselineIgnore not found
error: warnings found and -Werror specified
/home/runner/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.22.1/bea6fede6[32](https://github.com/creek-service/json-schema-validation-comparison/actions/runs/7632745461/job/20793563134?pr=123#step:7:33)8fabafd7e68[36](https://github.com/creek-service/json-schema-validation-comparison/actions/runs/7632745461/job/20793563134?pr=123#step:7:37)3161a7ea6605abd1/log4j-api-2.22.1.jar(/org/apache/logging/log4j/Level.class): warning: Cannot find annotation method 'value()' in type 'BaselineIgnore': class file for aQute.bnd.annotation.baseline.BaselineIgnore not found
1 error
2 warnings

> Task :compileJava FAILED

Reproduction

PR reproducing the issue: creek-service/json-schema-validation-comparison#123

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