Getting Started: IntelliJ Setup - Yash-777/mongo-java-driver GitHub Wiki

Open source doesn’t just mean free to download and use, it also means it’s possible for anyone to contribute code. But it’s down to us, the maintainers of the project, to make this process simple and clear to those who want to help.

With this in mind, I’ve prepared a guide to getting IntelliJ set up for coding on the Java Driver - in particular, the new 3.0 code. This guide is for IntelliJ 13, as it has much better integration with Gradle, and should import the project correctly given our Gradle settings. This may still work as a guide for earlier versions of IntelliJ, but your mileage may vary.

These instructions are for the Mac (sorry) but should work on Linux too. On Windows, you might have to use your imagination and reverse some slashes and so forth for the first part, the command-line stuff.

Get the code

Create (or navigate to) the location you want the code to live in

$ mkdir ~/Documents/projects/github
$ cd ~/Documents/projects/github/

Download the Java Driver code

$ git clone https://github.com/mongodb/mongo-java-driver.git

Navigate into the project and switch to the 3.0.x branch

$ cd mongo-java-driver
$ git checkout 3.0.x

Command Line commands

Import into IntelliJ

Open IntelliJ, and select File -> Import Project

Import project menu

Navigate to the location you put the code in, select the mongo-java-driver directory and click OK

Select mongo-java-driver

Select “Import project from external model” and “Gradle”

Select Gradle