Skip to content

Compiling with 2.24.0 fails: module not found: org.jspecify #2929

@xzel23

Description

@xzel23

Description

I have a modular (Jigsaw) project that uses log4j2. Compilation fails after updating to 2.24.0 from 2.23.1 with the error "".

Configuration

Version: 2.24.0

Operating system: macOS 14.6.1

JDK:

openjdk 21.0.4 2024-07-16 LTS
OpenJDK Runtime Environment (build 21.0.4+9-LTS)
OpenJDK 64-Bit Server VM (build 21.0.4+9-LTS, mixed mode, sharing)

Logs

Running my gradle build, I get this:

23:21:38: Executing 'build'...

> Task :utility-logging:processResources NO-SOURCE
> Task :utility-fx-web:generateCatalogAsToml FROM-CACHE
> Task :generateCatalogAsToml FROM-CACHE
> Task :utility-db:generateCatalogAsToml FROM-CACHE
> Task :utility-logging:generateCatalogAsToml FROM-CACHE
> Task :utility:generateCatalogAsToml FROM-CACHE
> Task :utility-fx-icons-ikonli:generateCatalogAsToml FROM-CACHE
> Task :utility-fx-db:generateCatalogAsToml FROM-CACHE
> Task :utility-fx:generateCatalogAsToml FROM-CACHE
> Task :utility-fx-web:processResources NO-SOURCE
> Task :utility-fx-controls:generateCatalogAsToml FROM-CACHE
> Task :compileJava NO-SOURCE
> Task :utility-fx-db:processResources NO-SOURCE
> Task :utility-db:processResources
> Task :utility-fx:processResources
> Task :utility-fx-controls:processResources
> Task :utility-fx-icons-ikonli:processResources

> Task :utility-fx-icons:compileJava FAILED

> Task :utility-logging:sourcesJar
> Task :utility-fx-icons-ikonli:sourcesJar
> Task :utility-fx-db:sourcesJar
> Task :utility-fx-web:sourcesJar
> Task :utility-fx:sourcesJar
> Task :utility-fx-controls:sourcesJar
error: module not found: org.jspecify
1 error
> Task :utility-db:sourcesJar
> Task :cabe

> Task :utility:compileJava FAILED
23 actionable tasks: 14 executed, 9 from cache
error: module not found: org.jspecify
1 error

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':utility-fx-icons:compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':utility:compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights.
==============================================================================

BUILD FAILED in 448ms
23:21:39: Execution finished 'build'.

Reproduction

Sorry, still have not had the time to create a minimal project. I think any project using modules working with 2.23.1 should expose the error - I still need to investigate. But changing the log4j2 version is the only change I did before running into this error and changing back to 2.23.1 fixed it. Compile with version 2.23.1, then try again using 2.24.0.

My project does (obviously) not use jspecify, adding it as a dependency will probably fix it.

I see this in the log4j-core module-info.class and think jspecify should be a transitive dependency and the static might have to be removed:

        requires static transitive org.jspecify;

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect, unexpected, or unintended behavior of existing codejpmsAffects Java module (JPMS) integration

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions