您的位置:首页 > 其它

thrift 的安装编译

2016-08-17 00:00 134 查看
thrift 的安装编译

1 : 从官网下载最新的包 http://thrift.apache.org/download thrift-0.9.3.tar.gz

2 :解压 thrift-0.9.3.tar.gz 包; tar -zxvf thrift-0.9.3.tar.gz 生成目录 thrift-0.9.3

3 :进入thrift-0.9.3 目录 执行 ./configurate --with-java

执行过程中如果出现错误 error: Bison version 2.5 or higher must be installed on the system!  说明 Bison 版本低了 需要重新装下

wget http://ftp.gnu.org/gnu/bison/bison-3.0.4.tar.gz tar -zxvf bison-3.0.4.tar.gz
cd bison-3.0.4
./configure
make && make install

4 : make && make install

5 : mavne 配置插件 支持 代码自动生成;执行mvn clean install 后即可重新生成源文件

<build>
<plugins>
<plugin>
<groupId>org.apache.thrift.tools</groupId>
<artifactId>maven-thrift-plugin</artifactId>
<version>0.1.11</version>
<executions>
<execution>
<id>thrift-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>thrift-test-sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: