Why Is it impossible to use json in Gradle from 8.0 onwards?
I have some .kts scripts where I read some local files that are JSONs
c
Chris Lee
12/08/2022, 4:00 PM
Is there a specific error message or limitation you are referencing?
f
FunkyMuse
12/08/2022, 6:04 PM
Limitation, JSON can’t be used in Gradle KTS probably groovy too 🤔
Copy code
org.json.simple.*
isn’t available
c
Chris Lee
12/08/2022, 6:05 PM
that’s a 3rd party library, not part of Gradle. Import the library as required to use it.
a
Adam S
12/08/2022, 6:14 PM
I’ve got a Gradle 7.6 project, and I can’t import
org.json.simple.*
, so this isn’t particular to Gradle 8. My guess is that you used to have a Gradle plugin that had a dependency on org.json, but you haven’t applied the plugin, or the plugin has been updated to remove that dependency.
If you want to add the JSON library back, you can either do it in