jackson-core: jackson-core:2.15.0-rc1 causes Gradle (pre-7.6) build failure
When com.fasterxml.jackson.core:jackson-core:2.15.0-rc1
is in the buildscript dependencies it fails to write locks.
Expected Behavior
Build should succeed
Current Behavior
Build fails with the error
./gradlew build
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'project'.
> java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to create Jar file /Users/<redacted>/.gradle/caches/jars-9/c94f549fdaad0dab4fb786ae7d97e150/jackson-core-2.15.0-rc1.jar.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 569ms
Steps to Reproduce
Clone this repo and run ./gradlew build
Additional notes:
- Version
2.15.0-rc1
ofjackson-core
introduces a multi-release jar [link to release notes], which is likely the reason why this error occurs on this particular version and not earlier versions. - This bug does not reproduce in Gradle version 7.6.1
- I’m not sure whether this is an issue with jackson-core or with Gradle, so I opened an issue with Gradle too: https://github.com/gradle/gradle/issues/24390
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 2
- Comments: 20 (15 by maintainers)
Commits related to this issue
- fix: downgrade jackson version Downstream we have engineers that have run into https://github.com/FasterXML/jackson-core/issues/955 and https://github.com/gradle/gradle/issues/24390 (despite Gradle 7... — committed to cashapp/wisp by r3mariano a year ago
- fix: downgrade jackson version (#154) Downstream we have engineers that have run into https://github.com/FasterXML/jackson-core/issues/955 and https://github.com/gradle/gradle/issues/24390 (despite G... — committed to cashapp/wisp by r3mariano a year ago
- fix: downgrade jackson version (#154) Downstream we have engineers that have run into https://github.com/FasterXML/jackson-core/issues/955 and https://github.com/gradle/gradle/issues/24390 (despite G... — committed to cashapp/misk by r3mariano a year ago
- fix: downgrade jackson version (#154) Downstream we have engineers that have run into https://github.com/FasterXML/jackson-core/issues/955 and https://github.com/gradle/gradle/issues/24390 (despite G... — committed to cashapp/misk by r3mariano a year ago
- Upgrade Gradle to 7.6.2 This requires (temporarily?) removing the Gradle linter plugin we use due to some mysterious incompatibility that I don't understand, however it fixes the issue with Jackson d... — committed to gbrodman/nomulus by gbrodman a year ago
- Upgrade Gradle to 7.6.2 This requires (temporarily?) removing the Gradle linter plugin we use due to some mysterious incompatibility that I don't understand, however it fixes the issue with Jackson d... — committed to gbrodman/nomulus by gbrodman a year ago
- fix: downgrade jackson version (#154) Downstream we have engineers that have run into https://github.com/FasterXML/jackson-core/issues/955 and https://github.com/gradle/gradle/issues/24390 (despite G... — committed to cashapp/misk by r3mariano a year ago
- Upgrade gradle to 7.6.2 This fixes https://github.com/FasterXML/jackson-core/issues/955 when building via GitHub Actions. — committed to rhdunn/xquery-intellij-plugin by rhdunn a year ago
- Bump Gradle to 7.6.3 This is needed to use Jib 3.4.0, because of [1] [1] https://github.com/FasterXML/jackson-core/issues/955 — committed to rm3l/dev-feed by rm3l 8 months ago
So far, it looks like old versions of Gradle use an old version of asm and tries to analyse META-INF/versions classes that it shouldn’t. It seems newer versions of Gradle have fixed the issue. Please use newer versions of Gradle (7.6.1 and 8.0.2 do not hit the issue in the sample).
Resolution: if affected, upgrade to Gradle 7.6.1 or later. As per comment https://github.com/gradle/gradle/issues/24390#issuecomment-1480002416 should NOT affect basic dependency resolution.
Closing.
The issue is that Gradle’s asm jar needs to be upgraded every time there is a new Java release. I wish they would be able to code defensively around ignoring META-INF/version/X classes that are too new for their asm jar.
This is a bug in Gradle - gradle/gradle#24390
If the Jackson team are to worry about old versions of Gradle, I really don’t know where to go.
I don’t know if Gradle team will look at gradle/gradle#24390 - it’s possible that they will backport the Gradle 7.6 fix - but I suspect it is unlikely.
I must admit to being reluctant to volunteer time on this. I feel strongly that this is a bug in Gradle and one that has been fixed to boot.
So don’t upgrade jackson then. There is no real constraint not to update - just some management issue that is not my concern.