-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling with 2.24.0
fails: module not found: org.jspecify
#2929
Comments
Thanks for reporting this. The problem is due to the way JPMS resolution process works:
JSpecify is an annotation library, so it is I am not sure why BND considers JSpecify a requires static org.jspecify; In the meantime you can workaround the problem, by adding JSpecify as a compile-only dependency: compileOnly 'org.jspecify:jspecify:1.0.0' |
We remove the `transitive` modifier from all optional dependencies. Closes #2929.
2.24.0
fails: module not found: org.jspecify
This issue really messed up our builds. Could you consider adding perhaps some testing and CI to this project before running releases? That would be great, thanks. |
@rickardoberg, I understand your frustration and thanks so much for the feedback. See #2930 – there we are working on the solution and the test to avoid similar issues in the future. We will issue |
My concern with:
over this
I talked about in this comment here: jspecify/jspecify#495 (comment) I don't think Log4J2 is currently doing in reflective check of something being |
@vy Perhaps log4j2 should have a test module or example module (does not need to get deploy to maven central) that creates a JLink application. That is really the ultimate test if the modules (module-info) are correct. FWIW here is my logging library doing that: https://github.com/jstachio/rainbowgum/tree/main/test/rainbowgum-test-jlink Feel free to copy the jlink maven plugin part of the pom particularly this part: https://github.com/jstachio/rainbowgum/blob/0e6499536aa7978828397add2d545d4d7e1052b3/test/rainbowgum-test-jlink/pom.xml#L14 (that is it is not a normal java jar artifact). On every build we build a jlink app to make sure rainbowgum is jlink-able. |
We have a sample JLink application in our samples repository. I was concentrated on our sample GraalVM application, so I admittedly dropped the ball on this one. Feel free to submit a PR to our Github workflows to trigger the build of the |
This adds a Groovy script that fails the build if any optional JPMS module has the `transitive` qualifier. We remove the `transitive` modifier from all optional dependencies. Closes #2929. Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>
This adds a Groovy script that fails the build if any optional JPMS module has the `transitive` qualifier. We remove the `transitive` modifier from all optional dependencies. Closes #2929. Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>
Tested with current 2.24.1 from apache staging (built September 24 2024) and can confirm this is fixed. Thank you! |
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:
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:
The text was updated successfully, but these errors were encountered: