logging-log4j2
logging-log4j2 copied to clipboard
Add missing Jspecify version defintion
Add missing jspeficy version defintion
Fixes https://github.com/apache/logging-log4j2/issues/3758
[!IMPORTANT]
Base your changes on2.xbranch if you are targeting Log4j 2; usemainotherwise.
Checklist
Before we can review and merge your changes, please go through the checklist below. If you're still working on some items, feel free to submit your pull request as a draft—our CI will help guide you through the remaining steps.
✅ Required checks
-
[x] License: I confirm that my changes are submitted under the Apache License, Version 2.0.
-
[x] Commit signatures: All commits are signed and verifiable. (See GitHub Docs on Commit Signature Verification).
-
[x] Code formatting: The code is formatted according to the project’s style guide.
How to check and fix formatting
- To check formatting:
./mvnw spotless:check - To fix formatting:
./mvnw spotless:apply
See the build instructions for details.
- To check formatting:
-
[x] Build & Test: I verified that the project builds and all unit tests pass.
🧪 Tests (select one)
- [ ] I have added or updated tests to cover my changes.
- [x] No additional tests are needed for this change.
📝 Changelog (select one)
- [ ] I added a changelog entry in
src/changelog/.2.x.x. (See Changelog Entry File Guide). - [x] This is a trivial change and does not require a changelog entry.
The actual fix might be more convoluted. jspecify.version already exist in /pom.xml, though gets removed during BOM-ification right before deployment.
I don't know but it was clearly missing in the parent pom, so maybe that got resolved instead?
I don't know but it was clearly missing in the parent pom, so maybe that got resolved instead?
To expand a bit on what @vy pointed out:
- The
jspecify.versionproperty is currently defined in the top-level POM (/pom.xml), which corresponds to thelog4j-bommodule. - However, since we flatten
log4j-bombefore publishing it to Maven Central, any properties defined in that POM—includingjspecify.version—don’t make it into the published artifact. This is the root cause of the issue.
So rather than just duplicating the property in /log4j-parent/pom.xml, I’d suggest we:
- Remove the
jspecify.versionproperty from/pom.xml. - Move the configuration for the
java8-testsprofile (excluding the activator) from/pom.xmlto/log4j-parent/pom.xml.
This way, the property is defined at the right level (in the parent, where it will be inherited properly), and we avoid any confusion or redundancy between flattened and non-flattened modules.
📝 Changelog (select one)
- [ ] I added a changelog entry in
src/changelog/.2.x.x. (See Changelog Entry File Guide).- [x] This is a trivial change and does not require a changelog entry.
I’d actually argue this isn’t a trivial change—it addresses a significant issue that breaks dependency resolution and should have a changelog entry. We'll likely need to cut a 2.25.1 release to fix it, so thank you for identifying the root cause!
@ppkarwasz Thanks for the detailed explanation. It's probably easier if you take over this PR/fix
@Siedlerchr, thanks so much for the report and the fix, much appreciated. :bow:
I've provided a successor in #3763.