impala-java-client icon indicating copy to clipboard operation
impala-java-client copied to clipboard

Maven build error related to java:hashcode

Open ghost opened this issue 7 years ago • 6 comments

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?

ghost avatar Apr 25 '17 14:04 ghost

+1. Seeing the same error. Using maven thrift plugin: <artifactId>maven-thrift-plugin</artifactId> 0.1.11

Codess2015 avatar Jun 28 '17 18:06 Codess2015

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.

mkorneev avatar Jul 28 '17 09:07 mkorneev

Does this necessarily put a cap on the thrift version that is usable with maven? Has anyone found a workaround here?

akawalsky avatar Mar 20 '18 23:03 akawalsky

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.

jfly avatar Oct 04 '18 01:10 jfly

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

artstwolf avatar Mar 12 '19 22:03 artstwolf

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!

XiaoyiPeng avatar Nov 09 '22 08:11 XiaoyiPeng