MongoDB.local SF, Jan 15: See the speaker lineup & ship your AI vision faster. Use WEB50 to save 50%
Find out more >
Docs Menu
Docs Home
/ /
/ / /

다운로드 및 설치

1

개발 환경에 JDK 버전 8 이상이 설치되어 있는지 확인합니다.

이 가이드 에서는 통합 개발 환경(IDE)에서 Maven 또는 Gradle을 사용하여 MongoDB Java 운전자 종속성을 추가하는 방법을 보여줍니다. IntelliJ IDEA 또는 Eclipse IDE와 같은 IDE를 사용할 것을 권장합니다. IDE를 사용하면 프로젝트 를 빌드 하고 실행 하도록 Maven 또는 Gradle을 더 편리하게 구성할 수 있습니다.

IDE를 사용하지 않는 경우 프로젝트 설정하다 방법에 대한 자세한 내용은 Maven 빌드 또는 새 Gradle 빌드 만들기 를 참조하세요. Maven에서 직접 운전자 및 종속성을 다운로드 하려면 MongoDB Reactive Streams 드라이버 참조하세요.

2

In your IDE, create a new Maven or Gradle project. This guide uses methods from the Reactor library, a library based on the Reactive Streams specification, so you must add its Bill of Materials (BOM) for dependency management. Add the BOM for MongoDB JVM artifacts and Project Reactor to your project to organize dependency versions. The BOM simplifies dependency management by ensuring that you maintain consistent and compatible versions of dependencies, such as between the Java Reactive Streams driver and the core driver library. Use the BOM to avoid version conflicts and simplify upgrades.

다음 MavenGradle 탭에서 선택하여 각 종속성 관리자에 대한 BOM을 추가하는 방법에 대한 지침을 확인합니다.

pom.xml 파일 의 dependencyManagement 목록에 다음 코드를 추가합니다.

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-bom</artifactId>
<version>5.6.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-bom</artifactId>
<version>2025.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

Add the following code to the dependencies list in your build.gradle.kts file. The code examples in this guide use the Kotlin DSL for Gradle:

dependencies {
implementation(platform("org.mongodb:mongodb-driver-bom:5.6.1"))
implementation(platform("io.projectreactor:reactor-bom:2025.0.0"))
}

To view a list of dependencies that the BOM manages, see the mongodb-driver-bom dependency and the reactor-bom dependency listings on the Maven Repository website.

3

If you are using Maven, add the following to your pom.xml file:

<dependencies>
...
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

To install Reactor by using Gradle, add the following to your build.gradle.kts dependencies list:

dependencies {
...
implementation("io.projectreactor:reactor-core")
}

Because you installed the BOM, you can omit a version in the Project Reactor dependency entry. The version you specify in the BOM determines the dependency versions to install.

종속성을 구성한 후에는 종속성 관리자를 실행 하고 IDE에서 프로젝트 를 새로 고쳐 프로젝트 에서 사용할 수 있는지 확인합니다.

4

프로젝트 에서 Maven을 사용하는 경우 pom.xml 종속성 목록에 다음을 추가합니다.

<dependencies>
...
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-reactivestreams</artifactId>
</dependency>
</dependencies>

Gradle을 사용하는 경우 build.gradle.kts 종속성 목록에 다음을 추가합니다.

dependencies {
...
implementation("org.mongodb:mongodb-driver-reactivestreams")
}

BOM을 설치했으므로 Java Reactive Streams 운전자 종속성 항목에서 버전을 생략할 수 있습니다. BOM에 지정한 버전에 따라 설치할 종속성 버전이 결정됩니다.

종속성을 구성한 후에는 종속성 관리자를 실행 하고 IDE에서 프로젝트 를 새로 고쳐 프로젝트 에서 사용할 수 있는지 확인합니다.

이 단계를 완료하면 새 프로젝트 와 운전자 종속성이 설치됩니다.

참고

이 단계에서 문제가 실행 하면 이 페이지의 오른쪽 또는 오른쪽 하단에 있는 Rate this page 탭 사용하여 피드백 제출 .

일반적인 질문에 대한 지원은 MongoDB Stack Overflow 태그 또는 MongoDB Reddit Community를 사용하여 찾을 수 있습니다.

돌아가기

시작하기