Specifying a dependency of the JAX-RS client API

To use the client part of the JAX-RS specification, the client application needs to depend only on the client part of the JAX-RS libraries. If you use the Jersey implementation, the dependency entry in pom.xml will look like the following:

<dependency> 
    <groupId>org.glassfish.jersey.core</groupId> 
    <artifactId>jersey-client</artifactId> 
    <version>2.19</version><!-sets the correct version --> 
</dependency> 

This is the minimum dependency that the application needs to have for using the Jersey implementation of the JAX-RS client APIs. You need to add additional modules for availing specific runtime features. For instance, to enable the automatic conversion of the response content type (for example, JSON) to a desired Java class at runtime, you need to add a dependency to the jersey-media-moxy JAR file, as shown here:

<dependency> 
  <groupId>org.glassfish.jersey.media</groupId> 
  <artifactId>jersey-media-moxy</artifactId> 
  <version>2.5.1</version> 
</dependency> 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.250.11