Skip to content

Commit

Permalink
Update exchange compilation steps (#1364)
Browse files Browse the repository at this point in the history
  • Loading branch information
randomJoe211 authored Jan 7, 2022
1 parent 0f5c990 commit cb85074
Showing 1 changed file with 33 additions and 39 deletions.
72 changes: 33 additions & 39 deletions docs-2.0/nebula-exchange/ex-ug-compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## 直接下载 JAR 文件

社区版 Exchange 的 JAR 文件可以直接[下载](https://repo1.maven.org/maven2/com/vesoft/nebula-exchange/)
社区版 Exchange 的 JAR 文件可以直接[下载](https://github.com/vesoft-inc/nebula-exchange/releases)

要下载企业版 Exchange,需先[获取 Nebula Graph 企业版套餐](https://nebula-graph.com.cn/pricing/)

Expand All @@ -19,52 +19,46 @@
### 前提条件

- 安装 [Maven](https://maven.apache.org/download.cgi)

<!-- pulsar 所在的 maven 库 5 月 31 日被官方关闭,还没找到迁移位置,找到后这里可以删掉-->
- 下载 [pulsar-spark-connector_2.11](https://oss-cdn.nebula-graph.com.cn/jar-packages/pulsar-spark-connector_2.11.zip),解压到本地 Maven 库的目录`io/streamnative/connectors`中。
- 根据数据源安装需要的 Spark 版本,从各数据源导出数据支持的 Spark 版本参见[软件依赖](about-exchange/ex-ug-limitations.md)

### 操作步骤

1. 在根目录克隆仓库`nebula-exchange`

```bash
git clone -b {{exchange.branch}} https://github.com/vesoft-inc/nebula-exchange.git
```
```bash
git clone -b {{exchange.branch}} https://github.com/vesoft-inc/nebula-exchange.git
```

2. 切换到目录`nebula-exchange`

```bash
cd nebula-exchange/nebula-exchange
```

3. 打包 Nebula Exchange。

```bash
mvn clean package -Dmaven.test.skip=true -Dgpg.skip -Dmaven.javadoc.skip=true
```

编译成功后,用户可以在当前目录里查看到类似如下目录结构。

```text
.
├── README-CN.md
├── README.md
├── pom.xml
├── src
│   ├── main
│   └── test
└── target
├── classes
├── classes.timestamp
├── maven-archiver
├── nebula-exchange-2.x.y-javadoc.jar
├── nebula-exchange-2.x.y-sources.jar
├── nebula-exchange-2.x.y.jar
├── original-nebula-exchange-2.x.y.jar
└── site
```

`target`目录下,用户可以找到`exchange-2.x.y.jar`文件。
```bash
cd nebula-exchange
```

3. 根据 Exchange 使用环境中的 Spark 版本打包 Exchange。

- Spark 2.2:

```bash
mvn clean package -Dmaven.test.skip=true -Dgpg.skip -Dmaven.javadoc.skip=true \
-pl nebula-exchange_spark_2.2 -am -Pscala-2.11 -Pspark-2.2
```

- Spark 2.4:

```bash
mvn clean package -Dmaven.test.skip=true -Dgpg.skip -Dmaven.javadoc.skip=true \
-pl nebula-exchange_spark_2.4 -am -Pscala-2.11 -Pspark-2.4
```

- Spark 3.0:

```bash
mvn clean package -Dmaven.test.skip=true -Dgpg.skip -Dmaven.javadoc.skip=true \
-pl nebula-exchange_spark_3.0 -am -Pscala-2.12 -Pspark-3.0
```

编译成功后,可以在`nebula-exchange_spark_x.x/target/`目录里找到`nebula-exchange_spark_x.x-{{exchange.branch}}.jar`文件。`x.x`代表 Spark 版本,例如`2.4`

!!! note
JAR 文件版本号会因 Nebula Java Client 的发布版本而变化。用户可以在 [Releases 页面](https://github.com/vesoft-inc/nebula-java/releases)查看最新版本。
Expand Down

0 comments on commit cb85074

Please sign in to comment.