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

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

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

 

1.安装 docker (自行安装)

需要设置一下共享目录:

MAC版本: Hadoop3.2.0 源码编译 [ 二 ]_第1张图片

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

 

MAC版本: Hadoop3.2.0 源码编译 [ 二 ]_第2张图片

 

等待构建完成.

MAC版本: Hadoop3.2.0 源码编译 [ 二 ]_第3张图片

安装成功如图:

MAC版本: Hadoop3.2.0 源码编译 [ 二 ]_第4张图片

 

 

 

 

3. 输入命令进行编译

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

----------------------------------------------------------------------------------
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].

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

MAC版本: Hadoop3.2.0 源码编译 [ 二 ]_第5张图片

 

MAC版本: Hadoop3.2.0 源码编译 [ 二 ]_第6张图片

 

导入项目即可:

 

MAC版本: Hadoop3.2.0 源码编译 [ 二 ]_第7张图片

MAC版本: Hadoop3.2.0 源码编译 [ 二 ]_第8张图片

 

MAC版本: Hadoop3.2.0 源码编译 [ 二 ]_第9张图片

 

 

 

 

 

你可能感兴趣的:(Hadoop3.2.0,源码)