• 造成thrift 编译构建项目失败的原因之一:thrift环境变量没设置


    由于重装了系统和IDEA工具,打开原项目时使用install 构建使用thrift 协议的项目时失败。下面是说说我遇到的问题

    看下图,就是构建时控制台输出的日志,因为是乱码,当时没重视,就先去检查pom.xml文件配置是否正确

    检查了pom配置没有问题,上网找的信息也非常少,只能想办法解决乱码看看日志输出的具体错误信息

    <dependency>
    		  <groupId>org.apache.thrift</groupId>
    		  <artifactId>libthrift</artifactId>
    		  <version>0.9.3</version>
    		</dependency>
    
     <plugin>
        
    
     <plugin>
    	            <groupId>org.apache.thrift.tools</groupId>
    	            <artifactId>maven-thrift-plugin</artifactId>
    	            <version>0.1.11</version>
    	            <configuration>
    	                <thriftExecutable>thrift</thriftExecutable>
    	            </configuration>
    	            <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>
    

      

    解决控制台乱码设置

    重新构建了下,知道了具体原因,才想起还需要配置thrift.exe windows环境(2年没动过了重装系统后忘记步骤了)

    去官网http://thrift.apache.org/download 下载thrift.exe,然后设置环境变量的 path 变量,把thrift.exe 所在目录加上就行

    最后打开cmd 验证是否成功:thrift -version

    输出版本号信息代表设置成功

    Thrift version 0.9.3
    

    然后重启IDEA开发工具,重新构建就成功了 

  • 相关阅读:
    Linux Bash常用命令记录
    Ubuntu 环境 openMVG+openMVS 配置
    GDB调试系列之了解GDB
    OpenCV4系列之图像梯度
    ffmpeg基本功能使用
    GDB调试系列之基础入门
    STL std::pair基本用法
    判断机器CPU的大小端模式并将数据转换成小端形式
    由对象集合创建各种映射_流
    静态类型与函数重载
  • 原文地址:https://www.cnblogs.com/jingping/p/10949414.html
Copyright © 2020-2023  润新知