Open ghost opened 7 years ago
+1. Seeing the same error. Using maven thrift plugin:
<version>0.1.11</version>
This issue appears with thrift 0.10.0 because it doesn't have java:hashcode option anymore. Downgrading to thrift 0.9.3 worked for me.
Does this necessarily put a cap on the thrift version that is usable with maven? Has anyone found a workaround here?
It looks like when thrift removed the java:hashcode
option, they defaulted it to on, so it should be safe to run the latest version of thrift and simply remove this parameter. See https://issues.apache.org/jira/browse/THRIFT-2263 for more information.
I found on this SO post that adding <generator>java</generator>
to the maven-thrift-plugin configuration fixes the issue so you can use newer thrift versions:
<plugin>
<groupId>org.apache.thrift.tools</groupId>
<artifactId>maven-thrift-plugin</artifactId>
<version>0.1.11</version>
<configuration>
<thriftSourceRoot>${basedir}/src/main/resources/thrift</thriftSourceRoot>
<generator>java</generator>
</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>
^ from the SO post
I found on this SO post that adding
<generator>java</generator>
to the maven-thrift-plugin configuration fixes the issue so you can use newer thrift versions:<plugin> <groupId>org.apache.thrift.tools</groupId> <artifactId>maven-thrift-plugin</artifactId> <version>0.1.11</version> <configuration> <thriftSourceRoot>${basedir}/src/main/resources/thrift</thriftSourceRoot> <generator>java</generator> </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>
^ from the SO post
Thank you very much!
I'm unable to build this project, I'm getting:
`[INFO] ------------------------------------------------------------------------ [INFO] Building impala-client 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-thrift-plugin:0.1.11:compile (thrift-sources) @ impala-client --- [ERROR] thrift failed output:
[ERROR] thrift failed error: [FAILURE:generation:1] Error: unknown option java:hashcode ` Does anyone know what can cause this?