maven有了maven-thrift-plugin,机器还需要安装thrift才能用吗?

有一个用了thrift的工程
mvn package打包,有如下错误

[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce) @ waimai_c_api_client ---
[INFO] 
[INFO] --- maven-thrift-plugin:0.1.11:compile (thrift-sources) @ waimai_c_api_client ---
[ERROR] thrift failed output: 
[ERROR] thrift failed error: /bin/sh: thrift: command not found

意思是不是有了maven-thrift-plugin这个maven插件还不够,还需要机器也安装thrift

另外,工程引入的libthrift是0.8.0版本

<dependency>
    <groupId>org.apache.thrift</groupId>
    <artifactId>libthrift</artifactId>
    <version>0.8.0</version>
    <type>pom</type>
</dependency>

那机器中应该安装的thrift版本最新的版本也可以?

阅读 5.8k
1 个回答

是的,需要安装 thrift.

参见源码: https://github.com/dtrott/mav...

    /**
     * This is the path to the {@code thrift} executable. By default it will search the {@code $PATH}.
     *
     * @parameter default-value="thrift"
     * @required
     */
    private String thriftExecutable;

默认的是 thrift(在当前环境搜索路径下找)。
可以通过参数指定位置,如:


 <plugin>
                <groupId>org.apache.thrift.tools</groupId>
                <artifactId>maven-thrift-plugin</artifactId>
                <version>0.1.10</version>
                <configuration>
                    <thriftExecutable>/usr/local/bin/thrift</thriftExecutable>
                </configuration>
...
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题