org.apache.maven.plugin.MojoExecutionException: protoc failure org.apache.maven.plugin.MojoExecutionException: protoc failure hadoop hadoop

org.apache.maven.plugin.MojoExecutionException: protoc failure


The instructions at http://wiki.apache.org/hadoop/HowToContribute explain some of the less obvious aspects of building hadoop - including this one. The main problem here is that Protocol Buffers are required by hadoop's YARN framework, and you most likely do not have them installed.

It seems like the problem might be that your not interpretting the error correctly, so --

How to Isolate the Build error

Any mojo which fails should be associated with a class.

In this case, the mojo that is failing is here :

https://svn.apache.org/repos/asf/hadoop/common/trunk/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java

Looking at the code, its clear that this Mojo requires the "protoc" program to run.

http://code.google.com/p/protobuf/

Solution

To build hadoop, you need protocol buffers. This can be installed on a *NIX machine from source, by running the following commands to grab the code from googlecode (taken from http://numbers.brighterplanet.com/2012/04/14/how-to-install-mosh-on-amazon-ec2/).

wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gztar xzf protobuf-2.4.1.tar.gzcd protobuf-2.4.1./configuremakesudo make installsudo ldconfig