1. git clone https://github.com/cloudera/flume.git
2. git checkout 0.9.4-branch 0.9.4 是目前的稳定版本
3. 修改flume/pom.xml <thrift.executable>/usr/local/bin/thrift</thrift.executable> 注:thrift 必須是0.6.0版本,否则编译通不过
4. 执行 mvn install
5. 第4步无法通过,原因是 thrift 和 avro 自动生成的代码没有进build-path,必须将其加入到build-path,请见附1;
或者是将自动生成的代码cp到src目录,这样应该更好
6. 编译仍然无法通过,还需要添加jline依赖
7. done
注:thrift download url: http://archive.apache.org/dist/thrift/0.6.0/thrift-0.6.0.tar.gz
附1:
flume/flume-core/.classpath
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry kind="src" path="target/generated-sources/annotations"/>
<classpathentry kind="src" path="target/generated-sources/avro"/>
<classpathentry kind="src" path="target/generated-sources/version"/>
<classpathentry kind="src" path="target/generated-sources/antlr3"/>
<classpathentry kind="src" path="target/generated-sources/thrift"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>