In general, there are two options available on how to include
the Client SDK in your project. You can either manually include
all dependencies in your CLASSPATH or (if you
want to make your life easier) use
Maven.
To include the libraries (jar files) directly
in your project,
download
the archive and add all jar files to your
CLASSPATH of the system/project. Most IDEs
also allow you add specific jar files to your
project. Make sure to have the following dependencies in your
CLASSPATH:
couchbase-client-1.1.4.jar
spymemcached-2.8.12.jar
commons-codec-1.5.jar
httpcore-4.1.1.jar
netty-3.5.5.Final.jar
httpcore-nio-4.1.1.jar
jettison-1.1.jar
If you don't like to handle dependencies on your own, you can
use a build manager to handle them for you. Couchbase provides a
Maven repository
that you can use which includes the dependencies automatically.
The root URL of the repository is located under
http://files.couchbase.com/maven2/.
Depending on the build manager you're using, the exact syntax to
include it may vary. Here is an example on how to do it in Maven
by updating your pom.xml.
<repositories> <repository> <id>couchbase</id> <name>Couchbase Maven Repository</name> <layout>default</layout> <url>http://files.couchbase.com/maven2/</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <dependency> <groupId>couchbase</groupId> <artifactId>couchbase-client</artifactId> <version>1.1.4</version> <scope>provided</scope> </dependency>
If you are coming from Scala and want to manage your
dependencies through
sbt, then you can
do it this way (in your build.sbt):
resolvers += "Couchbase Maven Repository" at "http://files.couchbase.com/maven2" libraryDependencies += "couchbase" % "couchbase-client" % "1.1.4"