I would like to put JSON dependency in the build.gradle, in order to fix the error MessageBodyWriter not found for media type=application/json
.
In my previous question I learned that it was very likely that I did not include JSON as dependency in my build.gradle file.
I added the dependency as shown below (line 8, last compile
)
apply plugin: 'war'
apply plugin: 'jetty'
dependencies {
compile fileTree(dir: 'lib', include: '**/*.jar')
compile(project(":qa-common"))
compile(project(":alm"))
compile 'org.glassfish.jersey.media:jersey-media-json-jackson:2.3.10'
}
jettyRun {
httpPort = 8080
reload = 'automatic'
scanIntervalSeconds = 2
daemon = false
}
Now I am getting the error of Could not resolve all dependencies for configuration'
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':qa-automation-console:compile'.
> Cannot resolve external dependency org.glassfish.jersey.media:jersey-media-json-jackson:2.3.10 because no repositories are defined.
Required by:
qaauto:qa-automation-console:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 5.273 secs
I am checking whether I have included the correct version of gradle and Jersey (in web.xml I see 2.5 but 2.5 still gives the same error). In my jersey server side code the only package related to jersey was import org.glassfish.jersey.server.mvc.Viewable;
Anyone give me a clue what I need to add?