---
title: "hadoop maven 编译出错"
author: "tycomputer"
date: "2014-12-17T08:55:42Z"
tags: []
categories: ["开源软件"]
slug: "hadoop-maven"
draft: false
lastmod: "2014-12-17T09:26:50Z"
id: 2166916
url: "https://tycomputer.iteye.com/blog/2166916"
---

mvn package -Pdist,native -DskipTests -Dtar 编译源码出现

```java

[error] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:2.5.0:protoc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecutionException: protoc version is 'libprotoc 2.4.1', expected version is '2.5.0' -> [help 1]
[error] 
[error] To see the full stack trace of the errors, re-run Maven with the -e switch.
[error] Re-run Maven using the -X switch to enable full debug logging.
[error] 
[error] For more information about the errors and possible solutions, please read the following articles:
[error] [help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[error] 
[error] After correcting the problems, you can resume the build with the command
[error]   mvn <goals> -rf :hadoop-common

```


先安装g++等
sudo apt-get install g++ autoconf automake libtool cmake zlib1g-dev pkg-config libssl-dev



安装protoc ，不好下载的话，可以下载附件
wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz 


执行 
sudo make 
sudo make check 
sudo make install 
protoc --version 


后来编译 mvn package -Pdist,native -DskipTests -Dtar 就OK了