Migrating Couchbase to MongoDB: Configuring the Maven Project

We need to add some Maven dependencies to the project classpath. Add the dependencies listed in Table 7-1 to pom.xml configuration file in the Maven project.

The pom.xml is listed below.

<project xmlns=”http://maven.apache.org/POM/4.0.0″ xmlns:xsi=”http://www.w3.org/2001/

XMLSchema-instance”

xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/ maven-4.0.0.xsd”>

<modelVersion>4.0.0</modelVersion>

<groupId>com.mongodb.migration</groupId>

<artifactId>CouchbaseToMongoDB</artifactId>

<version>1.0.0</version>

<name>CouchbaseToMongoDB</name>

<dependencies>

<dependency>

<groupId>com.couchbase.client</groupId>

<artifactId>java-client</artifactId>

<version>2.1.4</version>

</dependency>

<dependency>

<groupId>org.mongodb</groupId>

<artifactId>mongo-java-driver</artifactId>

<version>3.0.3</version>

</dependency>

<dependency>

<groupId>commons-beanutils</groupId>

<artifactId>commons-beanutils</artifactId>

<version>1.9.2</version>

</dependency>

<dependency>

<groupId>commons-collections</groupId>

<artifactId>commons-collections</artifactId>

<version>3.2.1</version>

</dependency>

<dependency>

<groupId>commons-logging</groupId>

<artifactId>commons-logging</artifactId>

<version>1.2</version>

</dependency>

</dependencies>

</project>

Select File Save All to save the pom.xml configuration file. The required jar files get downloaded, and get added to the Java build path. To find which Jars have been added to the Maven project Java build path, right-click on the project node in Package Explorer and select Properties. In Properties select Java Build Path. The Jars added to the migration project are shown in Figure 7-9.

Source: Vohra Deepak (2015), Pro MongoDB™ Development, Apress; 1st ed. edition.

Leave a Reply

Your email address will not be published. Required fields are marked *