Created on 06-01-2016 01:54 PM
brew install maven autoconf automake cmake libtool
brew tap homebrew/versions
brew install homebrew/versions/protobuf250
git clone git://git.apache.org/hadoop.git
mvn clean package -Pdist,native -Dtar -DskipTests=true -Dmaven.site.skip=true -Dmaven.javadoc.skip=true
Created on 06-03-2016 12:04 AM
I would like to add that you might have to edit the IntelliJ VM settings, if not done already. This is to avoid out of memory errors and also improve performance. This can be done by editing the idea.vmoptions file in one of the following ways:
Change the VM properties as follows.
-Xms4096m -Xmx4096m -XX:MaxPermSize=2048m -XX:ReservedCodeCacheSize=1024m -XX:+UseCompressedOops
Note that these are just sample values and you can have your own custom set of values for these parameters.
Also note that there is a limit on what theses values can be set to. Setting the ReservedCodeCacheSize to 4096M in a 16GB RAM machine will prevent IntelliJ from booting up (It can at most be 2048M).
Created on 06-03-2016 12:08 AM
Thanks for your tips!
Created on 06-08-2016 10:09 PM
Hello @Mingliang Liu. Nice article! I'd like to add that in step 7, when doing a distro build, I often like to speed it up a little more by passing the argument -Dmaven.javadoc.skip=true. As long as I don't need to inspect JavaDoc changes, this can make the build complete faster.
Created on 06-09-2016 06:31 PM
Good writeup @Mingliang Liu. In addition to what @Chris Nauroth said, I also add -Dmaven.site.skip=true.
mvn clean package -Pdist,native -Dtar -DskipTests=true -Dmaven.site.skip=true -Dmaven.javadoc.skip=true
Created on 06-13-2016 07:05 PM
Thank you @Chris Nauroth and @Arpit Agarwal for your helpful comments. I updated the article, and my MAVEN_OPTS env variable 🙂
Created on 04-17-2017 07:42 AM
In MacOS Sierra you need to setup openSSL manually before running mvn package command.
brew update brew install openssl
This will install the openssl + development libraries / headers to /usr/local/opt/openssl but wont link them, even if you try brew link --force. But this will put the development headers and libraries in /usr/local/opt/openssl. So you should to the following before building it.
export OPENSSL_ROOT_DIR=/usr/local/opt/openssl
Then run the mvn package command
Created on 10-08-2017 02:03 AM
Great article!
I faced the following error when I tried to build using maven(step 7):
Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.1.0-SNAPSHOT:protoc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecutionException: 'protoc --version' did not return a version
Here is how I resolved this by creating a symlink:
ln -s /usr/local/Cellar/protobuf@2.5/2.5.0/bin/protoc /usr/local/bin
Created on 10-08-2017 02:11 AM
This saved me a good couple hours! Thanks!
Created on 05-13-2018 04:33 AM
The step 5 is stale. The latest one is run command `brew install protobuf@2.5`
Created on 05-13-2018 04:37 AM
You are right. The current homebrew has deprecated the `homebrew/versions` and the new migrated protobuf@2.5 installation does not change the default bin in PATH. As you suggested, you can link it in your PATH, or follow the instruction of `brew info protobuf@2.5`