Optional Dependencies
The project is structured in a manner that many dependencies are optional. This is done in order to keep the package small, as the diverse functionality provided by the various classes require many other libraries that may be non-trival or result in conflicts with your own project.
The following is a list of dependencies that would be required to use all features of this library. You may incorporate them directly in your pom.xml
.
Jersey (RI of JAX-RS) is required for manipulating URIs (when uri()
method is used):
<dependency> <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-client</artifactId> <version>2.25.1</version> </dependency>
Of course, you can use any other JAX-RS implementation, like RESTEasy, for example.
The following dependencies are needed for using JsonResponse
and RequestBody
:
<dependency> <groupId>javax.json</groupId> <artifactId>javax.json-api</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.json</artifactId> <version>1.0.4</version> </dependency>
If you prefer to use the Jackson Project (JacksonResponse
) as the JSON processor you'll have to include the following dependencies instead:
<dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.7.6</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.7.6</version> </dependency>
Use of XmlResponse
will require the following dependencies, as well as the Hamcrest dependencies below:
<dependency> <groupId>com.jcabi</groupId> <artifactId>jcabi-matchers</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>com.jcabi</groupId> <artifactId>jcabi-xml</artifactId> <version>0.7.8</version> </dependency> <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.2.11</version> </dependency> <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jsr173_api</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>net.sourceforge.saxon</groupId> <artifactId>saxon</artifactId> <version>9.1.0.8</version> </dependency> <dependency> <groupId>net.sourceforge.saxon</groupId> <artifactId>saxon</artifactId> <version>9.1.0.8</version> </dependency>
Use of the com.jcabi.http.mock
classes will require the following dependencies, as well as the Hamcrest dependencies (see below):
<dependency> <groupId>com.sun.grizzly</groupId> <artifactId>grizzly-servlet-webserver</artifactId> <version>1.9.59</version> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-client</artifactId> <version>1.18.1</version> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-core</artifactId> <version>1.18.1</version> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-server</artifactId> <version>1.18.1</version> </dependency>
The Hamcrest dependencies are required if you need to use the com.jcabi.http.mock
classes, the RestResponse
class with its assertion mechanisms, or the XmlResponse
class:
<dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-library</artifactId> <version>1.3</version> </dependency> <dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-core</artifactId> <version>1.3</version> </dependency>
Usage of ApacheRequest
will require the Apache HTTP Components dependencies:
<dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpcore</artifactId> <version>4.3</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.3</version> </dependency>
If you need to use JsoupResponse
, you need to import the JSoup library:
<dependency> <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.7.3</version> </dependency>