zoukankan      html  css  js  c++  java
  • 造成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开发工具,重新构建就成功了 

  • 相关阅读:
    poj_2506_Tiling_201407211555
    poj_2524_Ubiquitous Religions_201407211506
    poj_2586_Y2K Accounting Bug_201407211318
    poj_3006_Dirichlet's Theorem on Arithmetic Progressions_201407041030
    POJ训练计划
    nyoj_10_skiing_201405181748
    nyoj_308_Substring_201405091611
    nyoj_205_求余数_201404271630
    hdu_2082_找单词_201404271536
    nyoj_176_队花的烦恼二_201404262008
  • 原文地址:https://www.cnblogs.com/jingping/p/10949414.html
Copyright © 2011-2022 走看看