One reason for the failure of thrift compiler to build the project: thrift environment variable is not set

Due to reinstall the system and IDEA tool, use the install failed when opening the project to build the original project when using thrift protocol. The following is a talk about my problem

 

See the figure, is building a console output log, because it is garbled, then did not pay attention, you go to check whether the correct configuration file pom.xml

 

Check the specific error message pom configuration without problems, the Internet to find information is also very small and can only think of ways to solve the garbage look at the log output

<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>

  

Solve garbled console settings

 

Rebuilt the next, know the specific reasons, to remember also need to configure thrift.exe windows environment (2 years did not move a step forget to reinstall the system after a)

 

Quguan network http://thrift.apache.org/download  download thrift.exe, and then set the path variable environment variables, plus the thrift.exe directory on the line

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

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

Thrift version 0.9.3

 

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

 

Guess you like

Origin www.cnblogs.com/jingping/p/10949414.html