How to add a dependency to Maven
Add the following com.mongodb : mongo-java-driver maven dependency to the pom.xml
file with your favorite IDE (IntelliJ / Eclipse / Netbeans):
<dependency>
<groupId>com.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>2.7.1</version>
</dependency>
How to add a dependency to Gradle
Gradle Groovy DSL: Add the following com.mongodb : mongo-java-driver gradle dependency to your build.gradle
file:
implementation 'com.mongodb:mongo-java-driver:2.7.1'
Gradle Kotlin DSL: Add the following com.mongodb : mongo-java-driver gradle kotlin dependency to your build.gradle.kts
file:
implementation("com.mongodb:mongo-java-driver:2.7.1")
How to add a dependency to SBT Scala
SBT Scala: Add the following com.mongodb : mongo-java-driver sbt scala dependency to your build.sbt
file:
libraryDependencies += "com.mongodb" % "mongo-java-driver" % "2.7.1"