pauldeschacht / impala-java-client

Java client to connect directly to Impala using thrift
35 stars 31 forks source link

Maven build error related to java:hashcode #6

Open ghost opened 7 years ago

ghost commented 7 years ago

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?

Codess2015 commented 7 years ago

+1. Seeing the same error. Using maven thrift plugin:

maven-thrift-plugin
            <version>0.1.11</version>
mkorneev commented 7 years ago

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.

akawalsky commented 6 years ago

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

jfly commented 6 years ago

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.

artstwolf commented 5 years ago

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

XiaoyiPeng commented 1 year ago

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!