MAC版本: Hadoop3.2.0 源码编译 [ 二 ]

MAC版本,Hadoop3.2.0 提供了 docker 编译的方式.

构建方式非常简单, 不过首先你要先安装好 docker.

1.安装 docker (自行安装)

需要设置一下共享目录:

2.运行: start-build-env.sh

等待构建完成.

安装成功如图:

扫描二维码关注公众号,回复: 5991246 查看本文章

3. 输入命令进行编译

----------------------------------------------------------------------------------
Building distributions:

Create binary distribution without native code and without documentation:

  $ mvn package -Pdist -DskipTests -Dtar -Dmaven.javadoc.skip=true

Create binary distribution with native code and with documentation:

  $ mvn package -Pdist,native,docs -DskipTests -Dtar

Create source distribution:

  $ mvn package -Psrc -DskipTests

Create source and binary distributions with native code and documentation:

  $ mvn package -Pdist,native,docs,src -DskipTests -Dtar

Create a local staging version of the website (in /tmp/hadoop-site)

  $ mvn clean site -Preleasedocs; mvn site:stage -DstagingDirectory=/tmp/hadoop-site

Note that the site needs to be built in a second pass after other artifacts.

----------------------------------------------------------------------------------

4. 如果你想源码 debug 的话,需要生成 protos 类. 需要在命令行里运行如下命令. eclipse 和 idea 通用.

----------------------------------------------------------------------------------
Importing projects to eclipse

When you import the project to eclipse, install hadoop-maven-plugins at first.

  $ cd hadoop-maven-plugins
  $ mvn install

Then, generate eclipse project files.

  $ mvn eclipse:eclipse -DskipTests

At last, import to eclipse by specifying the root directory of the project via
[File] > [Import] > [Existing Projects into Workspace].

----------------------------------------------------------------------------------

导入项目即可:

猜你喜欢

转载自blog.csdn.net/zhanglong_4444/article/details/89388958