I have a problem where I’m trying to include org.json
as a dependency in my gradle/spring boot project. In my build.gradle I have
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-security")
compile("org.json:json:20141113")
}
But in the editor window it looks like IntelliJ is not able to import org.json - it’s unable to find the package
What’s weird is that I can run the gradle ‘build’ task without errors in IntelliJ, and I can run
./gradlew clean build && java -jar build/libs/MyApp-0.1.0.jar
and it works fine.
Is this a ‘fat jar’ problem? I’m not sure it is because org.json
is definitely not in my class path on the command line. Any advice appreciated.
JsonArray represents an immutable JSON array (an ordered sequence of zero or more values). It also provides an unmodifiable list view of the values in the array. A JsonArray object can be created by reading JSON data from an input source or it can be built from scratch using an array builder object.
To add a dependency to your project, specify a dependency configuration such as implementation in the dependencies block of your module's build.gradle file.
I was able to successfully download json in my gradle dependencies:
implementation 'org.json:json:20171018'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With